mirror of https://github.com/astral-sh/ruff
Update release workflow to checkout the given sha (#7279)
This commit is contained in:
parent
4bff397318
commit
1373e1c395
|
|
@ -7,12 +7,15 @@ on:
|
||||||
description: "The version to tag, without the leading 'v'. If omitted, will initiate a dry run (no uploads)."
|
description: "The version to tag, without the leading 'v'. If omitted, will initiate a dry run (no uploads)."
|
||||||
type: string
|
type: string
|
||||||
sha:
|
sha:
|
||||||
description: "Optionally, the full sha of the commit to be released"
|
description: "The full sha of the commit to be released. If omitted, the latest commit on the default branch will be used."
|
||||||
|
default: ""
|
||||||
type: string
|
type: string
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
# When we change pyproject.toml, we want to ensure that the maturin builds still work
|
# When we change pyproject.toml, we want to ensure that the maturin builds still work
|
||||||
- pyproject.toml
|
- pyproject.toml
|
||||||
|
# And when we change this workflow itself...
|
||||||
|
- .github/workflows/release.yaml
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
|
@ -31,6 +34,8 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.sha }}
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
@ -57,6 +62,8 @@ jobs:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.sha }}
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
@ -95,6 +102,8 @@ jobs:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.sha }}
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
@ -141,6 +150,8 @@ jobs:
|
||||||
arch: x64
|
arch: x64
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.sha }}
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
@ -187,6 +198,8 @@ jobs:
|
||||||
- i686-unknown-linux-gnu
|
- i686-unknown-linux-gnu
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.sha }}
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
@ -244,6 +257,8 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.sha }}
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
@ -297,6 +312,8 @@ jobs:
|
||||||
- i686-unknown-linux-musl
|
- i686-unknown-linux-musl
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.sha }}
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
@ -351,6 +368,8 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.sha }}
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
@ -399,6 +418,8 @@ jobs:
|
||||||
if: ${{ inputs.tag }}
|
if: ${{ inputs.tag }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.sha }}
|
||||||
- name: Check tag consistency
|
- name: Check tag consistency
|
||||||
run: |
|
run: |
|
||||||
version=$(grep "version = " pyproject.toml | sed -e 's/version = "\(.*\)"/\1/g')
|
version=$(grep "version = " pyproject.toml | sed -e 's/version = "\(.*\)"/\1/g')
|
||||||
|
|
@ -410,6 +431,15 @@ jobs:
|
||||||
else
|
else
|
||||||
echo "Releasing ${version}"
|
echo "Releasing ${version}"
|
||||||
fi
|
fi
|
||||||
|
- name: Check main branch
|
||||||
|
if: ${{ inputs.sha }}
|
||||||
|
run: |
|
||||||
|
# Fetch the main branch since a shallow checkout is used by default
|
||||||
|
git fetch origin main --unshallow
|
||||||
|
if ! git branch --contains ${{ inputs.sha }} | grep -E '(^|\s)main$'; then
|
||||||
|
echo "The specified sha is not on the main branch" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
- name: Check SHA consistency
|
- name: Check SHA consistency
|
||||||
if: ${{ inputs.sha }}
|
if: ${{ inputs.sha }}
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -465,6 +495,8 @@ jobs:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.sha }}
|
||||||
- name: git tag
|
- name: git tag
|
||||||
run: |
|
run: |
|
||||||
git config user.email "hey@astral.sh"
|
git config user.email "hey@astral.sh"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue