Skip to content

Commit 183758e

Browse files
authored
Workflow fix (#57)
* Update release.yml * Update build_apk.yml
1 parent 704725c commit 183758e

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

.github/workflows/build_apk.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,29 @@ jobs:
5858
${{ runner.os }}-gradle-
5959
6060
- if: ${{ github.event.inputs.is_nightly == 'false' }}
61-
name: Retrieve the secret and decode it to a file
61+
name: Retrieve the secret and decode it to a file, and Build release apk
6262
env:
6363
KEY_BASE64: ${{ secrets.KEY_BASE64 }}
64-
run: |
65-
echo $KEY_BASE64 | base64 --decode > app/key.jks
66-
67-
- if: ${{ github.event.inputs.is_nightly == 'false' }}
68-
name: Build apk
69-
env:
7064
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
7165
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
7266
STORE_PASSWORD: ${{ secrets.KEY_PASSWORD }}
73-
run: ./gradlew assembleRelease
67+
run: |
68+
echo $KEY_BASE64 | base64 --decode > app/key.jks
69+
./gradlew assembleRelease
70+
echo "APP_VARIANT=release" >> $GITHUB_ENV
7471
75-
- if: ${{ github.event.inputs.is_nightly == 'true' }}
76-
name: Build apk
77-
run: ./gradlew assembleNightly
72+
- if: ${{ (github.event.inputs.is_nightly == 'true') || (github.event.inputs.is_nightly == '') }}
73+
name: Build nightly apk
74+
run: |
75+
./gradlew assembleNightly
76+
echo "APP_VARIANT=nightly" >> $GITHUB_ENV
7877
7978
- run: |
8079
mkdir -p packages
8180
8281
# warning: do not use github.event syntax here
8382
# https://stackoverflow.com/questions/71458189/github-action-workflow-call-does-not-use-up-to-date-input-values
84-
mv app/build/outputs/apk/release/app-release.apk packages/gitnote-release-${{ inputs.version }}.apk
83+
mv app/build/outputs/apk/${{ env.APP_VARIANT }}/app-release.apk packages/gitnote-${{ env.APP_VARIANT }}-${{ inputs.version }}.apk
8584
8685
- uses: actions/upload-artifact@v4
8786
with:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
secrets: inherit
7373
with:
7474
version: ${{ needs.setup-env.outputs.version_name }}
75-
is_nightly: ${{ github.event.inputs.is_nightly }}
75+
is_nightly: ${{ inputs.is_nightly }}
7676

7777
publish:
7878
needs: [build-apk, setup-env]

0 commit comments

Comments
 (0)