Skip to content

release

release #14

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g. 0.41.0)'
required: true
type: string
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v2
with:
client-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIV_KEY }}
- id: get-user-id
name: Get GitHub app user ID
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: "${{ steps.app-token.outputs.token }}"
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v5
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0
- name: Bump version
env:
NEW_VERSION: ${{ inputs.version }}
run: |
make bump version=${NEW_VERSION}
- name: Commit and tag
run: |
# ID from https://api.github.com/users/authentik-automation[bot]
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'
git add -A
git commit -m "release: bump version to ${{ inputs.version }}"
git tag v${{ inputs.version }}
git push origin HEAD:main
git push origin v${{ inputs.version }}
- name: Create draft release
run: |
gh release create v${{ inputs.version }} \
--draft \
--generate-notes \
--title "v${{ inputs.version }}"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}