Skip to content

Commit f848070

Browse files
authored
Update main.yml
Now only produces Beta SnapEnhance Build's (v2.0.0+) and gets now run when either push-here.md or core.apk gets changed
1 parent 146c14c commit f848070

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

.github/workflows/main.yml

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
paths:
66
- 'push-here.md'
7+
- '**/core.apk'
78

89
jobs:
910
build:
@@ -24,37 +25,37 @@ jobs:
2425
with:
2526
node-version: 16
2627

27-
- name: Get Latest Artifact URL
28-
id: get_artifact
29-
run: |
30-
repo_owner="rhunk"
31-
repo_name="SnapEnhance"
32-
workflow_name="beta.yml"
33-
pat="${{ secrets.SNAP_ENHANCE_WORKFLOW_ARTIFACT }}"
28+
- name: Check out code
29+
uses: actions/checkout@v2
3430

35-
artifact_url=$(curl -s -H "Authorization: Bearer $pat" \
36-
"https://api.github.com/repos/${repo_owner}/${repo_name}/actions/workflows/${workflow_name}/runs?status=success&per_page=1" \
37-
| jq -r '.workflow_runs[0].artifacts_url')
31+
- name: Install dependencies
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y jq curl
35+
shell: bash
3836

39-
download_url=$(curl -s -H "Authorization: Bearer $pat" \
40-
"$artifact_url" \
41-
| jq -r '.artifacts[0].archive_download_url')
37+
- name: Install unzip
38+
run: sudo apt-get install unzip -y
4239

43-
echo "Artifact URL: $artifact_url"
44-
echo "Download URL: $download_url"
40+
- name: Install pup
41+
run: |
42+
wget https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip -O pup.zip
43+
unzip pup.zip
44+
chmod +x pup
45+
sudo mv pup /usr/local/bin/
46+
working-directory: .
4547

46-
echo "download_url=$download_url" >> $GITHUB_ENV
47-
shell: bash
48+
- name: Grant execute permissions to script
49+
run: chmod +x script.sh
50+
working-directory: .
4851

49-
- name: Download Latest core.apk
52+
- name: Run APK Download Script
5053
run: |
51-
download_url="${{ env.download_url }}"
52-
wget "$download_url" -O "$GITHUB_WORKSPACE/core.apk"
54+
./script.sh
5355
5456
- name: Run the command
5557
run: |
56-
java -jar lspatch.jar -m artifact/core.apk -f -l 2 -v snap.apk
57-
working-directory: $GITHUB_WORKSPACE
58+
java -jar lspatch.jar -m "$GITHUB_WORKSPACE/core.apk" -f -l 2 -v snap.apk
5859
5960
- name: Upload artifact
6061
uses: actions/upload-artifact@v2
@@ -78,4 +79,4 @@ jobs:
7879
uses: softprops/action-gh-release@v1
7980
with:
8081
files: snap-360-lspatched.apk
81-
tag_name: ${{ env.RELEASE_VERSION }}
82+
tag_name: ${{ env.RELEASE_VERSION }}-Beta # Append "-Beta" to the tag name

0 commit comments

Comments
 (0)