diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5de3b3dd9..fbabbe436 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,11 +31,12 @@ jobs: with: distribution: temurin java-version: ${{ matrix.java }} - # - name: setup python for uploader - # uses: actions/setup-python@v5 - # with: - # python-version : '3.12' - # cache: pip + - name: setup python for uploader + if: github.ref == 'refs/heads/master' + uses: actions/setup-python@v5 + with: + python-version : '3.12' + cache: pip - name: cache loom-cache uses: actions/cache@v4 with: @@ -46,21 +47,21 @@ jobs: - name: build id: gradle run: ./gradlew --stacktrace --parallel clean build - # - name: Get Id Token - # if: github.ref == 'refs/heads/master' - # uses: actions/github-script@v7 - # id: idtoken - # with: - # script: | - # let id_token = await core.getIDToken("https://mc.pswg.dev") - # core.setOutput('id_token', id_token) - # - name: upload - # if: always() && github.ref == 'refs/heads/master' && (steps.gradle.outcome == 'success' || steps.gradle.outcome == 'failure') - # continue-on-error: true - # run: | - # pip install -r scripts/requirements.txt - # mkdir -p projects/pswg/build/libs - # cd projects/pswg/build/libs - # python ../../../../scripts/upload_dev.py --token ${{ steps.idtoken.outputs.id_token }} --result ${{ steps.gradle.outcome }} --webhook ${{ secrets.DISCORD_DEV_FEED_WEBHOOK }} --webhook ${{ secrets.DISCORD_RCOE_WEBHOOK }} --serverupdate ${{ secrets.SERVER_UPDATER }} - # env: - # BUILD_NUMBER: ${{ github.run_number }} + - name: Get Id Token + if: github.ref == 'refs/heads/master' + uses: actions/github-script@v7 + id: idtoken + with: + script: | + let id_token = await core.getIDToken("https://mc.pswg.dev") + core.setOutput('id_token', id_token) + - name: upload + if: always() && github.ref == 'refs/heads/master' && (steps.gradle.outcome == 'success' || steps.gradle.outcome == 'failure') + continue-on-error: true + run: | + pip install -r scripts/requirements.txt + mkdir -p projects/pswg/build/libs + cd projects/pswg/build/libs + python ../../../../scripts/upload_dev.py --token ${{ steps.idtoken.outputs.id_token }} --result ${{ steps.gradle.outcome }} --webhook ${{ secrets.DISCORD_DEV_FEED_WEBHOOK }} --webhook ${{ secrets.DISCORD_RCOE_WEBHOOK }} --serverupdate ${{ secrets.SERVER_UPDATER }} + env: + BUILD_NUMBER: ${{ github.run_number }}