Skip to content

Commit

Permalink
Fix upload script to only run on master
Browse files Browse the repository at this point in the history
  • Loading branch information
kb-1000 committed Oct 20, 2024
1 parent dea820a commit 748b15b
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}

0 comments on commit 748b15b

Please sign in to comment.