mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-03 05:03:33 +00:00
Checkout repo to support release tag validation (#5238)
## Summary
The
[release](9655224008)
failed due to an inability to find `pyproject.toml`. This PR moves that
validation into its own step (so we can fail fast) and ensures we clone
the repo.
This commit is contained in:
parent
e0339b538b
commit
a332f078db
1 changed files with 30 additions and 21 deletions
51
.github/workflows/release.yaml
vendored
51
.github/workflows/release.yaml
vendored
|
|
@ -4,7 +4,7 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: "The version to tag, without the leading 'v'. If omitted, will initiate a dry run skipping uploading artifact."
|
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: "Optionally, the full sha of the commit to be released"
|
||||||
|
|
@ -392,28 +392,14 @@ jobs:
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
*.sha256
|
*.sha256
|
||||||
|
|
||||||
release:
|
validate-tag:
|
||||||
name: Release
|
name: Validate tag
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
# If you don't set an input tag, it's a dry run (no uploads).
|
||||||
- macos-universal
|
|
||||||
- macos-x86_64
|
|
||||||
- windows
|
|
||||||
- linux
|
|
||||||
- linux-cross
|
|
||||||
- musllinux
|
|
||||||
- musllinux-cross
|
|
||||||
# If you don't set an input it's a dry run skipping uploading artifact
|
|
||||||
if: ${{ inputs.tag }}
|
if: ${{ inputs.tag }}
|
||||||
environment:
|
|
||||||
name: release
|
|
||||||
permissions:
|
|
||||||
# For pypi trusted publishing
|
|
||||||
id-token: write
|
|
||||||
# For GitHub release publishing
|
|
||||||
contents: write
|
|
||||||
steps:
|
steps:
|
||||||
- name: Consistency check tag
|
- uses: actions/checkout@v3
|
||||||
|
- 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')
|
||||||
if [ "${{ inputs.tag }}" != "${version}" ]; then
|
if [ "${{ inputs.tag }}" != "${version}" ]; then
|
||||||
|
|
@ -424,7 +410,7 @@ jobs:
|
||||||
else
|
else
|
||||||
echo "Releasing ${version}"
|
echo "Releasing ${version}"
|
||||||
fi
|
fi
|
||||||
- name: Consistency check sha
|
- name: Check SHA consistency
|
||||||
if: ${{ inputs.sha }}
|
if: ${{ inputs.sha }}
|
||||||
run: |
|
run: |
|
||||||
git_sha=$(git rev-parse HEAD)
|
git_sha=$(git rev-parse HEAD)
|
||||||
|
|
@ -436,6 +422,29 @@ jobs:
|
||||||
else
|
else
|
||||||
echo "Releasing ${git_sha}"
|
echo "Releasing ${git_sha}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- macos-universal
|
||||||
|
- macos-x86_64
|
||||||
|
- windows
|
||||||
|
- linux
|
||||||
|
- linux-cross
|
||||||
|
- musllinux
|
||||||
|
- musllinux-cross
|
||||||
|
- validate-tag
|
||||||
|
# If you don't set an input tag, it's a dry run (no uploads).
|
||||||
|
if: ${{ inputs.tag }}
|
||||||
|
environment:
|
||||||
|
name: release
|
||||||
|
permissions:
|
||||||
|
# For pypi trusted publishing
|
||||||
|
id-token: write
|
||||||
|
# For GitHub release publishing
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: wheels
|
name: wheels
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue