Skip to content

Commit dbc9a2a

Browse files
committed
Update to latest lspatch.jar, update both workflows so that both automatically download the latest CI Build core.apk from the official SnapEnhance repo
1 parent 6a20d96 commit dbc9a2a

File tree

4 files changed

+53
-45
lines changed

4 files changed

+53
-45
lines changed

.github/workflows/main.yml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,42 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13+
- name: Set up Java
14+
uses: actions/setup-java@v2
15+
with:
16+
distribution: 'adopt'
17+
java-version: '17'
18+
19+
- name: Set JAVA_HOME
20+
run: echo "JAVA_HOME=$(echo ${{ steps.setup-java.outputs.java-home }})" >> $GITHUB_ENV
21+
1322
- name: Set up Node.js
1423
uses: actions/setup-node@v2
1524
with:
1625
node-version: 16
1726

18-
- name: Check out code
19-
uses: actions/checkout@v2
20-
21-
- name: Install dependencies
27+
- name: Get Latest Artifact URL
28+
id: get_artifact
2229
run: |
23-
sudo apt-get update
24-
sudo apt-get install -y jq curl
25-
shell: bash
26-
27-
- name: Install unzip
28-
run: sudo apt-get install unzip -y
30+
repo_owner="rhunk"
31+
repo_name="SnapEnhance"
32+
workflow_name="beta.yml"
33+
34+
artifact_url=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
35+
"https://api.github.com/repos/${repo_owner}/${repo_name}/actions/workflows/${workflow_name}/runs?event=push&status=success&per_page=1" \
36+
| jq -r '.workflow_runs[0].artifacts_url')
2937
30-
- name: Install pup
31-
run: |
32-
wget https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip -O pup.zip
33-
unzip pup.zip
34-
chmod +x pup
35-
sudo mv pup /usr/local/bin/
36-
working-directory: .
38+
download_url=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
39+
"$artifact_url" \
40+
| jq -r '.artifacts[] | select(.name == "core.apk") | .archive_download_url')
3741
38-
- name: Grant execute permissions to script
39-
run: chmod +x script.sh
40-
working-directory: .
42+
echo "download_url=$download_url" >> $GITHUB_ENV
43+
shell: bash
4144

42-
- name: Run APK Download Script
45+
- name: Download Latest core.apk
4346
run: |
44-
./script.sh
47+
download_url="${{ env.download_url }}"
48+
wget "$download_url" -O "$GITHUB_WORKSPACE/core.apk"
4549
4650
- name: Run the command
4751
run: |

.github/workflows/schedule.yml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,42 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12+
- name: Set up Java
13+
uses: actions/setup-java@v2
14+
with:
15+
distribution: 'adopt'
16+
java-version: '17'
17+
18+
- name: Set JAVA_HOME
19+
run: echo "JAVA_HOME=$(echo ${{ steps.setup-java.outputs.java-home }})" >> $GITHUB_ENV
20+
1221
- name: Set up Node.js
1322
uses: actions/setup-node@v2
1423
with:
1524
node-version: 16
1625

17-
- name: Check out code
18-
uses: actions/checkout@v2
19-
20-
- name: Install dependencies
26+
- name: Get Latest Artifact URL
27+
id: get_artifact
2128
run: |
22-
sudo apt-get update
23-
sudo apt-get install -y jq curl
24-
shell: bash
25-
26-
- name: Install unzip
27-
run: sudo apt-get install unzip -y
29+
repo_owner="rhunk"
30+
repo_name="SnapEnhance"
31+
workflow_name="beta.yml"
32+
33+
artifact_url=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
34+
"https://api.github.com/repos/${repo_owner}/${repo_name}/actions/workflows/${workflow_name}/runs?event=schedule&status=success&per_page=1" \
35+
| jq -r '.workflow_runs[0].artifacts_url')
2836
29-
- name: Install pup
30-
run: |
31-
wget https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip -O pup.zip
32-
unzip pup.zip
33-
chmod +x pup
34-
sudo mv pup /usr/local/bin/
35-
working-directory: .
37+
download_url=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
38+
"$artifact_url" \
39+
| jq -r '.artifacts[] | select(.name == "core.apk") | .archive_download_url')
3640
37-
- name: Grant execute permissions to script
38-
run: chmod +x script.sh
39-
working-directory: .
41+
echo "download_url=$download_url" >> $GITHUB_ENV
42+
shell: bash
4043

41-
- name: Run APK Download Script
44+
- name: Download Latest core.apk
4245
run: |
43-
./script.sh
46+
download_url="${{ env.download_url }}"
47+
wget "$download_url" -O "$GITHUB_WORKSPACE/core.apk"
4448
4549
- name: Run the command
4650
run: |

lspatch.jar

378 KB
Binary file not shown.

push-here.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# A File to do dirty stuff - push in this file to trigger action
22
Snap 12.68.0.23 Beta & SnapEnhance CI Build ffd42de
33

4-
Add a dot here: ....
4+
Add a dot here: ...

0 commit comments

Comments
 (0)