Skip to content

Create Release

Create Release #7

name: Create Release
on:
workflow_dispatch:
inputs:
draft:
type: choice
description: "Create the release as draft"
options:
- "yes"
- "no"
default: "no"
required: true
force:
type: choice
description: "Force the creation of a release (event if no PR are found)"
options:
- "yes"
- "no"
default: "no"
required: true
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # we need this because fetch-tags=true and because of a GHA bug: https://github.com/actions/checkout/issues/1471
fetch-tags: true
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Run build
run: |
make build
- name: Run
run: |
OPTIONS=""
if test "${{ github.event.inputs.draft }}" == "yes"; then
OPTIONS="${OPTIONS} --release-draft"
fi
if test "${{ github.event.inputs.force }}" == "yes"; then
OPTIONS="${OPTIONS} --dont-increment-if-no-pr"
fi
echo "OPTIONS=${OPTIONS}"
./cmd/github-create-next-semantic-release/github-create-next-semantic-release --log-level=DEBUG ${OPTIONS} .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}