Write a workflow that cuts a release: tag push builds artifacts and creates a GitHub Release.
IntermediateHands-onWrite-a-pipeline tasks
Answer
on:
push:
tags: ["v*.*.*"]
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: make dist VERSION=${GITHUB_REF_NAME}
- run: gh release create "$GITHUB_REF_NAME" dist/* --generate-notes
env:
GH_TOKEN: ${{ github.token }}
Key trick → GITHUB_REF_NAME is the tag name (e.g. v1.4.2). Creating releases needs contents: write. --generate-notes builds the changelog from merged PRs.
More on Write-a-pipeline tasks
Write a GitHub Actions workflow that runs tests on every PR and push to main.BeginnerWrite a workflow that builds a Docker image and pushes it to ECR using OIDC (no access keys).IntermediateWrite a matrix job that tests on Python 3.10, 3.11 and 3.12 on Linux and Windows.BeginnerWrite a declarative Jenkinsfile with build, test, Docker push and a manual approval before prod.AdvancedWrite a GitHub Actions deploy job that requires approval for production using environments.BeginnerWrite a reusable workflow and call it from another repo.Intermediate