diff --git a/.github/workflows/build_and_upload.yml b/.github/workflows/build_and_upload.yml index 52cea367..5a124f23 100644 --- a/.github/workflows/build_and_upload.yml +++ b/.github/workflows/build_and_upload.yml @@ -3,19 +3,6 @@ on: push: tags: - v*.*.* - workflow_call: - outputs: - run_id: - value: ${{ github.run_id}} - apk: - value: ${{ jobs.build_apk.outputs.artifact }} - linux: - value: ${{ jobs.build_linux.outputs.artifact }} - appimage: - value: ${{ jobs.build_appimage.outputs.artifact }} - windows: - value: ${{ jobs.build_windows.outputs.artifact }} - workflow_dispatch: env: VERSION: ${{ github.head_ref || github.ref_name }} @@ -24,7 +11,7 @@ jobs: build_apk: runs-on: ubuntu-latest env: - ARTIFACT: frigoligo-${{ github.head_ref || github.ref_name }}-unsigned.apk + ARTIFACT: frigoligo-${{ github.head_ref || github.ref_name }}.apk outputs: artifact: ${{ env.ARTIFACT }} steps: @@ -41,7 +28,18 @@ jobs: - run: flutter pub get - run: flutter test - run: flutter build apk - - run: cp build/app/outputs/flutter-apk/app-release.apk $ARTIFACT + env: + NO_SIGNING: true + - name: Sign Release + uses: ilharp/sign-android-release@v1 + id: sign_release + with: + releaseDir: build/app/outputs/flutter-apk + signingKey: ${{ secrets.KEYSTORE_B64 }} + keyAlias: ${{ secrets.ALIAS }} + keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_PASSWORD }} + - run: cp build/app/outputs/flutter-apk/app-release-signed.apk $ARTIFACT - uses: actions/upload-artifact@v3 with: name: ${{ env.ARTIFACT }} diff --git a/.github/workflows/pr_builder.yml b/.github/workflows/pr_builder.yml deleted file mode 100644 index 6acbb05e..00000000 --- a/.github/workflows/pr_builder.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: on-demand pr build -on: - pull_request: - types: - - labeled - workflow_dispatch: - -env: - PR: ${{ github.event.pull_request.html_url }} - BRANCH: ${{ github.event.pull_request.head.ref }} - GH_TOKEN: ${{ github.token }} - GH_REPO: ${{ github.repository }} - -jobs: - prepare: - if: ${{ github.event.label.name == 'build-head' }} - runs-on: ubuntu-latest - steps: - - name: Remove label - run: gh pr edit $PR --remove-label build-head - - name: Add the acknowledgement comment - env: - COMMENT: 🏗️ A build has been started for this PR... - run: gh pr comment $PR --edit-last --body "$COMMENT" || gh pr comment $PR --body "$COMMENT" - - uses: actions/checkout@v4 - with: - sparse-checkout: | - .github/workflows - build: - name: Run the build workflow - needs: prepare - uses: ./.github/workflows/build_and_upload.yml - report: - needs: build - runs-on: ubuntu-latest - env: - APK: ${{ needs.build.outputs.apk }} - LINUX: ${{ needs.build.outputs.linux }} - APPIMAGE: ${{ needs.build.outputs.appimage }} - WINDOWS: ${{ needs.build.outputs.windows }} - steps: - - name: Compute run URL - run: echo RUN_URL=$(gh run view ${{ github.run_id }} --json url --jq .url) >> $GITHUB_ENV - - name: Publish the build result - run: gh pr comment $PR --edit-last --body "📦 The build has completed! The latest artifacts are available at $RUN_URL."