Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH actions: Update names of publish steps. Don't run prerelease steps when no prerelease is actually going to be published #2862

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading