Skip to content

Commit

Permalink
actions: better release (fixes #1888) (#1889)
Browse files Browse the repository at this point in the history
  • Loading branch information
dogi authored Feb 13, 2024
1 parent 1df067c commit 2dd5a54
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@ jobs:
ANDROID_NDK_VERSION: "21.3.6528147"
BUILD_TOOLS_VERSION: "34.0.0"
steps:
- name: run number with offset
id: version
- name: set more env
env:
NUM: ${{ github.run_number }}
run: echo "::set-output name=id::$(($NUM+6050))"
run: |
echo "VERSION="$(($NUM+6050)) >> $GITHUB_ENV
echo "BRANCH="${GITHUB_REF##*/} >> $GITHUB_ENV
- name: checkout repository code
uses: actions/checkout@v4

- name: set more env
run: echo "BRANCHNAME="${GITHUB_REF##*/} >> $GITHUB_ENV

- name: setup JDK 17
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -53,7 +51,7 @@ jobs:
ls -alR app/build/outputs
mkdir -p sign
cp app/build/outputs/bundle/release/app-release.aab sign/.
cp app/build/outputs/apk/release/remote-${{ steps.version.outputs.id }}.apk sign/app-release-unsigned.apk
cp app/build/outputs/apk/release/remote-${{ env.VERSION }}.apk sign/app-release-unsigned.apk
ls -al sign
- name: sign release APK and AAB
Expand Down Expand Up @@ -82,7 +80,7 @@ jobs:
packageName: io.treehouses.remote
releaseFiles: output/remote.aab
track: internal
releaseName: "${{ steps.version.outputs.id }}"
releaseName: "${{ env.VERSION }}"
status: completed

# - name: mobile security framework
Expand All @@ -107,19 +105,19 @@ jobs:
- name: rename APK and AAB with version and branch for artifact
if: github.ref != 'refs/heads/master'
run: |
mv output/remote.apk output/remote-${{ steps.version.outputs.id }}-${{ env.BRANCHNAME }}.apk
mv output/remote.apk.sha256 output/remote-${{ steps.version.outputs.id }}-${{ env.BRANCHNAME }}.apk.sha256
mv output/remote.aab output/remote-${{ steps.version.outputs.id }}-${{ env.BRANCHNAME }}.aab
mv output/remote.aab.sha256 output/remote-${{ steps.version.outputs.id }}-${{ env.BRANCHNAME }}.aab.sha256
#mv output/remote-${{ steps.version.outputs.id }}.pdf output/remote-${{ steps.version.outputs.id }}-${{ env.BRANCHNAME }}.pdf
mv output/remote.apk output/remote-${{ env.VERSION }}-${{ env.BRANCH }}.apk
mv output/remote.apk.sha256 output/remote-${{ env.VERSION }}-${{ env.BRANCH }}.apk.sha256
mv output/remote.aab output/remote-${{ env.VERSION }}-${{ env.BRANCH }}.aab
mv output/remote.aab.sha256 output/remote-${{ env.VERSION }}-${{ env.BRANCH }}.aab.sha256
#mv output/remote-${{ env.VERSION }}.pdf output/remote-${{ env.VERSION }}-${{ env.BRANCH }}.pdf
#cp app/build/outputs/mapping/release/mapping.txt output/mapping.txt
ls -alR output
- name: upload APK and AAB as build artifact
if: github.ref != 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: remote-${{ steps.version.outputs.id }}-${{ env.BRANCHNAME }}
name: remote-${{ env.VERSION }}-${{ env.BRANCH }}
path: output/*
retention-days: 9

Expand All @@ -129,7 +127,7 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: output/*
tag: v${{ steps.version.outputs.id }}
tag: v${{ env.VERSION }}
overwrite: true
file_glob: true

Expand All @@ -138,5 +136,5 @@ jobs:
run: |
sudo npm install -g @treehouses/cli
export discord_channel="${{ secrets.CHANNEL }}"
echo "https://github.com/treehouses/remote/releases/tag/v${{ steps.version.outputs.id }}"
treehouses feedback "new remote app: https://github.com/treehouses/remote/releases/tag/v${{ steps.version.outputs.id }}"
echo "https://github.com/treehouses/remote/releases/tag/v${{ env.VERSION }}"
treehouses feedback "new remote app: https://github.com/treehouses/remote/releases/tag/v${{ env.VERSION }}"

0 comments on commit 2dd5a54

Please sign in to comment.