Skip to content

Commit

Permalink
CI: Allow build to be triggered manually.
Browse files Browse the repository at this point in the history
  • Loading branch information
heiher committed Nov 23, 2024
1 parent c581b2e commit 47d5fde
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
release:
types:
- published
workflow_dispatch:

jobs:
build:
Expand All @@ -31,14 +32,35 @@ jobs:
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
yes | sdk/cmdline-tools/bin/sdkmanager --sdk_root=`pwd`/sdk --licenses
./gradlew assembleRelease
cp app/build/outputs/apk/release/hev.sockstun-*-release.apk hev.sockstun-release.apk
cp app/build/outputs/apk/release/hev.sockstun-*-release.apk hev.sockstun-${{ github.ref_name }}.apk
- name: Upload
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/upload-artifact@v4
with:
name: hev.sockstun-${{ github.ref_name }}.apk
path: hev.sockstun-${{ github.ref_name }}.apk
if-no-files-found: error
retention-days: 1

release:
name: Release
runs-on: ubuntu-20.04
needs: build
if: github.event_name == 'release'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Download artifacts
uses: actions/download-artifact@v4
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: hev.sockstun-release.apk
asset_name: hev.sockstun-${{ github.ref_name }}-release.apk
asset_content_type: application/octet-stream
path: release
pattern: "hev.sockstun-*"
merge-multiple: true
- name: Upload artifacts
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for i in release/hev.sockstun-*; do
gh release upload ${{ github.event.release.tag_name }} $i
done

0 comments on commit 47d5fde

Please sign in to comment.