-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.46 KB
/
update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Update v2rayA snap
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: '0 * * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y jq wget git python3-yaml
sudo snap install multipass
sudo snap install --classic snapcraft
python3 -m pip install yq==3.2.3
- name: Get Current Version
run: |
CURRENT_VERSION=$(yq -r '.version' snap/snapcraft.yaml)
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
- name: Export latest v2rayA version
run: |
NEW_VERSION=$(curl -s https://api.github.com/repos/v2rayA/v2rayA/releases/latest | jq -r '.tag_name | sub("^v"; "")')
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: Build .snap files
if: ${{ env.CURRENT_VERSION != env.NEW_VERSION }}
run: bash -x snap.sh ${NEW_VERSION}
- name: Release the snap to Snapcraft
if: ${{ env.CURRENT_VERSION != env.NEW_VERSION }}
run: |
export $SNAPCRAFT_STORE_CREDENTIALS
snapcraft push --release beta ./v2raya_${NEW_VERSION}_x64.snap
snapcraft push --release beta ./v2raya_${NEW_VERSION}_arm64.snap
snapcraft push --release beta ./v2raya_${NEW_VERSION}_riscv64.snap