diff --git a/.gitea/workflows/buildAndroid.yaml b/.gitea/workflows/buildAndroid.yaml index 12b8111..e70bfaf 100644 --- a/.gitea/workflows/buildAndroid.yaml +++ b/.gitea/workflows/buildAndroid.yaml @@ -7,6 +7,12 @@ jobs: - name: Checkout the code uses: actions/checkout@v2 + - name: Test + run: echo ${{ github.ref_name }} + + - name: Test 2 + run: echo ${{ github.ref }} + - name: Prepare signing run: | touch keystore.properties @@ -35,9 +41,31 @@ 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 + - 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(github.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-${{ github.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-${{ github.ref_name }}".aab" + \ No newline at end of file