Skip to content

Commit 48c176d

Browse files
authored
V0.0.2 (#1)
1 parent 238c679 commit 48c176d

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/auto_release.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: auto_release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
releaser:
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- uses: actions/checkout@master
11+
- name: Get Date
12+
id: date
13+
run: echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')"
14+
15+
- name: Create a tmp directory and copy files
16+
run: |
17+
mkdir -p ./build/sysroot/var/lib/casaos/appstore/default
18+
cp -r ./Apps ./build/sysroot/var/lib/casaos/appstore/default/
19+
- name: Compress action step
20+
uses: a7ul/[email protected]
21+
id: compress
22+
with:
23+
command: c
24+
files: |
25+
./build
26+
outPath: linux-all-casaos-appstore.tar.gz
27+
- name: command
28+
run: |
29+
ls
30+
echo "-----------------"
31+
ls ./build
32+
- name: Create Release
33+
uses: djnicholson/[email protected]
34+
with:
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
tag-name: '${{ steps.date.outputs.date }}'
37+
release-name: '${{ steps.date.outputs.date }}'
38+
asset-name: 'linux-all-casaos-appstore.tar.gz'
39+
file: './linux-all-casaos-appstore.tar.gz'
40+
- name: install sshpass
41+
run: sudo apt install sshpass --yes
42+
43+
- name: ZeroTier
44+
uses: zerotier/[email protected]
45+
with:
46+
network_id: ${{ secrets.ZEROTIER_NETWORK_ID }}
47+
auth_token: ${{ secrets.ZEROTIER_CENTRAL_TOKEN }}
48+
49+
- name: ping host
50+
shell: bash
51+
run: |
52+
count=10
53+
while ! ping -c 1 10.147.18.11 ; do
54+
echo "waiting..." ;
55+
sleep 1 ;
56+
let count=count-1
57+
done
58+
echo "ping success"
59+
- name: copy tar to target host
60+
shell: bash
61+
run: |
62+
sshpass -p "${{ secrets.ssh_password }}" scp -r -o StrictHostKeyChecking=no -P 22 './linux-all-casaos-appstore.tar.gz' [email protected]:/var/www/download
63+
echo "ping success"
64+
- name: send message
65+
run: |
66+
curl -X POST -H "Content-Type: application/json" -d '{"msg_type":"text","content":{"text":"CasaOS-NewAppStore updated"}}' ${{ secrets.SSH_ROBOT_URL }}
67+

0 commit comments

Comments
 (0)