mirror of https://github.com/locustio/locust.git
Simplify prerelease action merge commit detection.
This commit is contained in:
parent
d82e4b322c
commit
553ecdc309
|
@ -251,40 +251,40 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
# asking github if something was not a merge commit is surprisingly difficult
|
# asking github if something was 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
|
- run: git rev-parse HEAD^2 2>/dev/null >/dev/null && echo MERGE_COMMIT=1 | tee -a $GITHUB_ENV || true
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
if: ${{ env.NOT_MERGE_COMMIT == '' }}
|
if: env.MERGE_COMMIT
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.x"
|
python-version: "3.x"
|
||||||
- name: Set Node.js 20.x
|
- name: Set Node.js 20.x
|
||||||
if: ${{ env.NOT_MERGE_COMMIT == '' }}
|
if: env.MERGE_COMMIT
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 20.x
|
||||||
- name: Install Yarn
|
- name: Install Yarn
|
||||||
if: ${{ env.NOT_MERGE_COMMIT == '' }}
|
if: env.MERGE_COMMIT
|
||||||
run: npm install -g yarn
|
run: npm install -g yarn
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: ${{ env.NOT_MERGE_COMMIT == '' }}
|
if: env.MERGE_COMMIT
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip poetry
|
python -m pip install --upgrade pip poetry
|
||||||
python -m poetry config virtualenvs.create false
|
python -m poetry config virtualenvs.create false
|
||||||
python -m poetry self add "poetry-dynamic-versioning[plugin]"
|
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
|
# Pre-build the UI bundle and don't repeat it on the build step to allow sdist to find the files
|
||||||
- name: Prebuild UI
|
- name: Prebuild UI
|
||||||
if: ${{ env.NOT_MERGE_COMMIT == '' }}
|
if: env.MERGE_COMMIT
|
||||||
run: |
|
run: |
|
||||||
yarn webui:install
|
yarn webui:install
|
||||||
yarn webui:build
|
yarn webui:build
|
||||||
- name: Build
|
- name: Build
|
||||||
if: ${{ env.NOT_MERGE_COMMIT == '' }}
|
if: env.MERGE_COMMIT
|
||||||
run: |
|
run: |
|
||||||
SKIP_PRE_BUILD=true python -m poetry build
|
SKIP_PRE_BUILD=true python -m poetry build
|
||||||
./rename-wheel.sh
|
./rename-wheel.sh
|
||||||
- name: Publish prerelease version to PyPI
|
- name: Publish prerelease version to PyPI
|
||||||
if: ${{ env.NOT_MERGE_COMMIT == '' }}
|
if: env.MERGE_COMMIT
|
||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
with:
|
with:
|
||||||
user: __token__
|
user: __token__
|
||||||
|
|
Loading…
Reference in New Issue