forked from IceWhaleTech/CasaOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: raller1028 <[email protected]>
- Loading branch information
1 parent
96ff550
commit 8425011
Showing
1 changed file
with
18 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,24 +18,28 @@ jobs: | |
run: sudo apt install --yes git | ||
- name: git global | ||
run: sudo git config --global --add safe.directory '*' | ||
- | ||
name: Fetch all tags | ||
- name: set version | ||
run: sudo git tag v99.99.99-alpha | ||
|
||
- name: Fetch all tags | ||
run: sudo git fetch --force --tags | ||
|
||
- name: Get version | ||
id: get_version | ||
# run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
run: echo "VERSION=$(git describe --abbrev=0 --tags | awk -F- '{print $1}')" >> $GITHUB_ENV | ||
|
||
- name: show version | ||
id: show_version | ||
# run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
run: echo ${{env.VERSION}} | ||
- | ||
name: Set up Go | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.19 | ||
- | ||
name: Run GoReleaser | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
# either 'goreleaser' (default) or 'goreleaser-pro' | ||
|
@@ -48,11 +52,18 @@ jobs: | |
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | ||
- name: install sshpass | ||
run: sudo apt install sshpass --yes | ||
|
||
- name: ZeroTier | ||
uses: zerotier/[email protected] | ||
with: | ||
network_id: ${{ secrets.ZEROTIER_NETWORK_ID }} | ||
auth_token: ${{ secrets.ZEROTIER_CENTRAL_TOKEN }} | ||
|
||
- name: copy tar to target host | ||
shell: bash | ||
run: | | ||
sshpass -p "${{ secrets.ssh_password }}" scp -r -o StrictHostKeyChecking=no -P ${{ secrets.ssh_port }} ./dist/*.gz root@${{ secrets.ssh_ip }}:/var/www/download | ||
echo "ping success" | ||
- name: send message | ||
run: | | ||
curl -X POST -H "Content-Type: application/json" -d '{"msg_type":"text","content":{"text":"CasaOS updated"}}' https://open.feishu.cn/open-apis/bot/v2/hook/eb8f45c7-9636-4b64-84f2-a66d9aeb9d30 | ||
curl -X POST -H "Content-Type: application/json" -d '{"msg_type":"text","content":{"text":"CasaOS updated"}}' ${{ secrets.SSH_ROBOT_URL }} |