Skip to content

Commit

Permalink
GitHub workflow: Add release drafting
Browse files Browse the repository at this point in the history
This adds a new draft release when a tag is pushed.
  • Loading branch information
mook committed Jul 24, 2022
1 parent 8357919 commit fdc00e1
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ name: Build

on: [push]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
outputs:
project_name: ${{ steps.project_name.outputs.PROJECT_NAME }}
steps:
- uses: actions/checkout@v3
- name: Add Android tools to PATH
Expand All @@ -27,6 +32,10 @@ jobs:
fi
env:
ref: ${{ github.ref }}
- run: echo "::set-output name=PROJECT_NAME::${REPO##*/}"
id: project_name
env:
REPO: ${{ github.repository }}
- name: Sign
if: env.SIGNING_KEYSTORE && env.SIGNING_PASSWORD
run: |
Expand All @@ -36,14 +45,37 @@ jobs:
echo "${SIGNING_KEYSTORE}" | base64 -d > "${keystore}"
zipalign -v -p 4 app-release-unsigned.apk app-release-aligned.apk
apksigner sign --ks "${keystore}" --ks-pass "env:SIGNING_PASSWORD" --verbose \
--in app-release-aligned.apk --out app-release-signed.apk
--in app-release-aligned.apk --out "${{ steps.project_name.outputs.PROJECT_NAME }}.apk"
rm app-release-unsigned.apk app-release-aligned.apk
env:
SIGNING_KEYSTORE: ${{ secrets.ANDROID_SIGNING_KEYSTORE }}
SIGNING_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }}
working-directory: app/build/outputs/apk/release/
- uses: actions/upload-artifact@v3
with:
name: FenixXposed.apk
name: ${{ steps.project_name.outputs.PROJECT_NAME }}.apk
path: app/build/outputs/apk/release/*.apk
if-no-files-found: error
release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ needs.build.outputs.project_name }}.apk
- run: mv *.apk "${{ needs.build.outputs.project_name}}-${{ github.ref_name }}.apk"
- name: Draft Release
run: >
gh release create
--draft
--generate-notes
--target "${{ github.sha }}"
--title "${{ github.ref_name }}"
--repo "${{ github.repository }}"
"${{ github.ref_name }}"
*.apk
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit fdc00e1

Please sign in to comment.