Skip to content

Commit

Permalink
GH actions: Update names of publish steps. Don't run prerelease steps…
Browse files Browse the repository at this point in the history
… when no prerelease is actually going to be published (and avoid breaking everything)
  • Loading branch information
cyberw committed Aug 19, 2024
1 parent 2e618e0 commit bc79934
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ jobs:
tags: locustio/locust:${{ env.TAG }}${{ ( env.BRANCH == 'master' && ',locustio/locust:latest') || '' }}

publish:
name: PyPI - Publish if this is a tagged commit
name: Publish release on tag
needs: [verify_docker_build, tests]
if: startsWith(github.event.ref, 'refs/tags') && github.repository_owner == 'locustio'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -243,25 +243,29 @@ jobs:
# access_token_secret: ${{ secrets.TWITTER_API_ACCESS_TOKEN_SECRET }}

publish_prerelease:
name: PyPI - Publish prerelease on merge commit on master
name: Publish prerelease on merge commit to master
needs: tests
if: github.ref == 'refs/heads/master' && github.repository_owner == 'locustio'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# asking github if something was not a merge commit is surprisingly difficult
- run: git rev-parse HEAD^2 2>/dev/null >/dev/null || echo NOT_MERGE_COMMIT=1 | tee -a $GITHUB_ENV
- name: Set up Python
if: ${{ env.NOT_MERGE_COMMIT == '' }}
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Set Node.js 20.x
if: ${{ env.NOT_MERGE_COMMIT == '' }}
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install Yarn
if: ${{ env.NOT_MERGE_COMMIT == '' }}
run: npm install -g yarn
- run: git rev-parse HEAD^2 2>/dev/null >/dev/null || echo NOT_MERGE_COMMIT=1 | tee -a $GITHUB_ENV
- name: Install dependencies
if: ${{ env.NOT_MERGE_COMMIT == '' }}
run: |
Expand All @@ -270,6 +274,7 @@ jobs:
python -m poetry self add "poetry-dynamic-versioning[plugin]"
# Pre-build the UI bundle and don't repeat it on the build step to allow sdist to find the files
- name: Prebuild UI
if: ${{ env.NOT_MERGE_COMMIT == '' }}
run: |
yarn webui:install
yarn webui:build
Expand Down

0 comments on commit bc79934

Please sign in to comment.