Skip to content

REMOVE trigger on push #19

REMOVE trigger on push

REMOVE trigger on push #19

# Create a draft release when triggered via Github's UI or Github CLI
name: Prepare Release
on:
push:
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g. 0.11.0)'
required: true
type: string
permissions:
contents: write
jobs:
release:
name: Prepare Release
runs-on: ubuntu-latest
steps:
- name: Check version
run: |
if ! [[ '${{ '0.20' }}' =~ ^[0-9]+[.][0-9]+([.][0-9]+)?$ ]]; then
echo '${{ '0.20' }} does not match expected format `major.minor.patch?`' >&2
exit 1
fi
- name: Checkout
uses: actions/checkout@v4
#with:
# ref: master # only create releases from main branch
- name: Read section from CHANGELOG.md
id: extract-changelog
uses: sean0x42/markdown-extract@v2
with:
file: CHANGELOG.md
pattern: ${{ '0.20' }}
- name: Prepare release notes and artifacts
run: |
.github/workflows/release_prep.sh v${{ '0.20' }} > release_notes.txt
printf '${{ steps.extract-changelog.outputs.markdown }}' >> release_notes.txt
- name: Create draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create \
--draft \
--notes-file release_notes.txt \
--title v${{ '0.20' }} \
v${{ '0.20' }} \
rules_nixpkgs-${{ '0.20' }}.tar.gz