From d0d3bed3bc939e85bed3ee34d53664a2e7971687 Mon Sep 17 00:00:00 2001 From: Arno Krapf Date: Wed, 24 Jan 2024 10:19:29 +0100 Subject: [PATCH] adding separate deploy stage --- .github/workflows/android.yml | 62 ++++++++++++++++++++++++----- .github/workflows/qmllint-check.yml | 4 +- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 4a07072..2718d33 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -2,10 +2,11 @@ name: Android on: workflow_call: workflow_dispatch: + push: jobs: build: - runs-on: ubuntu-latest + runs-on: thuban container: image: stateoftheartio/qt6:6.6-android-aqt options: --user root @@ -14,8 +15,8 @@ jobs: QTOPCUA_BUILD_ARGS: "-DFEATURE_open62541_security:BOOL=ON -DFEATURE_gds:BOOL=ON -DCMAKE_BUILD_TYPE=Release" QT_PATH: "/opt/Qt/6.6.1" SSL_PATH: "dependencies/android_openssl/ssl_3" - ANDROID_VERSION_CODE: "3" - ANDROID_VERSION_NAME: "1.0.0" + ANDROID_VERSION_CODE: ${{github.run_number}} + ANDROID_VERSION_NAME: ${{github.ref}} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -103,14 +104,53 @@ jobs: keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} env: BUILD_TOOLS_VERSION: "33.0.0" - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: - name: Signed app bundle + name: android-apk path: ${{steps.sign_apk.outputs.signedReleaseFile}} - - uses: r0adkll/upload-google-play@v1 + - uses: actions/upload-artifact@v3 with: - serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} - releaseFiles: ${{steps.sign_aab.outputs.signedReleaseFile}} - packageName: com.basyskom.opcua.app - track: internal - status: draft \ No newline at end of file + name: android-abb + path: ${{steps.sign_aab.outputs.signedReleaseFile}} + + deploy: + needs: build + if: github.ref == 'refs/heads/prepare-for-github-ci' + runs-on: thuban + steps: + - uses: actions/download-artifact@v3 + - name: Rename APK + run: mv ./android-apk/android-build-release-unsigned-signed.apk ./android-apk/opc-ua-browser_${{ env.ANDROID_VERSION_NAME }}_${{ env.ANDROID_VERSION_CODE }}.apk + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + New Release ${{ github.ref }} + draft: true + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./android-apk/opc-ua-browser_${{ env.ANDROID_VERSION_NAME }}_${{ env.ANDROID_VERSION_CODE }}.apk + asset_name: opc-ua-browser_${{ env.ANDROID_VERSION_NAME }}_${{ env.ANDROID_VERSION_CODE }}.apk + asset_content_type: application/zip + #- uses: r0adkll/upload-google-play@v1 + # with: + # serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} + # releaseFiles: "${{steps.sign_aab.outputs.signedReleaseFile}}" + # packageName: com.basyskom.opcua.app + # track: internal + # status: draft + + +# ./android-abb/android-build-release.aab +# ./android-apk/android-build-release-unsigned-signed.apk \ No newline at end of file diff --git a/.github/workflows/qmllint-check.yml b/.github/workflows/qmllint-check.yml index a645778..7fef587 100644 --- a/.github/workflows/qmllint-check.yml +++ b/.github/workflows/qmllint-check.yml @@ -13,4 +13,6 @@ jobs: with: fetch-depth: 1 - name: Validate QML - uses: liri-infra/qmllint-action@master \ No newline at end of file + uses: liri-infra/qmllint-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}