From abdb59d0a385977495ac90be79feee7d9c07fc6f Mon Sep 17 00:00:00 2001 From: Fabian Zobrist Date: Fri, 30 Jun 2023 12:29:32 +0200 Subject: [PATCH] Publish tags --- .gitea/workflows/buildAndroid.yaml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/buildAndroid.yaml b/.gitea/workflows/buildAndroid.yaml index 12b8111..1e937d0 100644 --- a/.gitea/workflows/buildAndroid.yaml +++ b/.gitea/workflows/buildAndroid.yaml @@ -35,9 +35,32 @@ jobs: curl -k -u "${{ secrets.NEXTCLOUD_USERNAME }}:${{ secrets.NEXTCLOUD_PASSWORD }}" -T "app/build/outputs/apk/release/app-release.apk" "https://nextcloud.zobrist.me/remote.php/dav/files/deploy/TichuCounter/latest/app-release.apk" curl -k -u "${{ secrets.NEXTCLOUD_USERNAME }}:${{ secrets.NEXTCLOUD_PASSWORD }}" -T "app/build/outputs/bundle/release/app-release.aab" "https://nextcloud.zobrist.me/remote.php/dav/files/deploy/TichuCounter/latest/app-release.aab" + - uses: actions/upload-artifact@v3 + with: + name: latestTichuCounterBuild + path: | + app/build/outputs/apk/release/app-release.apk + app/build/outputs/bundle/release/app-release.aab + + - name: Notify Slack - uses: https://github.com/ravsamhq/notify-slack-action@v2 if: always() with: status: ${{ job.status }} # required env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required \ No newline at end of file + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required + + deploy: + runs-on: ubuntu-latest-android + if: startsWith(gitea.ref, 'refs/tags/') + steps: + - name: Get build files + - uses: actions/download-artifact@v3 + with: + name: latestTichuCounterBuild + + - name: Deploy tagged build to Nextcloud + run: | + curl -k -u "${{ secrets.NEXTCLOUD_USERNAME }}:${{ secrets.NEXTCLOUD_PASSWORD }}" -T "app/build/outputs/apk/release/app-release.apk" "https://nextcloud.zobrist.me/remote.php/dav/files/deploy/TichuCounter/tagged/app-release-${{ gitea.ref_name }}".apk" + curl -k -u "${{ secrets.NEXTCLOUD_USERNAME }}:${{ secrets.NEXTCLOUD_PASSWORD }}" -T "app/build/outputs/bundle/release/app-release.aab" "https://nextcloud.zobrist.me/remote.php/dav/files/deploy/TichuCounter/tagged/app-release-${{ gitea.ref_name }}".aab" + \ No newline at end of file