mirror of
https://github.com/fastapi/full-stack-fastapi-template.git
synced 2026-11-03 12:29:42 +00:00
df6f7a501c
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
53 lines
1.7 KiB
YAML
53 lines
1.7 KiB
YAML
name: Create Draft Release
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- closed
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
create-draft-release:
|
|
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
permissions:
|
|
contents: write
|
|
pull-requests: read
|
|
steps:
|
|
- name: Dump GitHub context
|
|
env:
|
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
run: echo "$GITHUB_CONTEXT"
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: ${{ github.event.repository.default_branch }}
|
|
persist-credentials: false
|
|
- name: Set up Python
|
|
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
with:
|
|
python-version-file: ".python-version"
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
|
|
with:
|
|
version: "latest-known"
|
|
- name: Extract release details
|
|
id: release-details
|
|
run: |
|
|
set -euo pipefail
|
|
version="$(uv run python scripts/prepare_release.py current-version)"
|
|
uv run python scripts/prepare_release.py release-notes > draft-release-notes.md
|
|
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
- name: Create draft release
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
VERSION: ${{ steps.release-details.outputs.version }}
|
|
run: |
|
|
set -euo pipefail
|
|
gh release create "$VERSION" \
|
|
--draft \
|
|
--title "$VERSION" \
|
|
--notes-file draft-release-notes.md \
|
|
--target "$(git rev-parse HEAD)"
|