Create Release #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Release | |
on: | |
workflow_dispatch: | |
inputs: | |
pre_release: | |
type: choice | |
description: Stage | |
options: | |
- stable | |
- rc | |
- beta | |
- alpha | |
version_type: | |
type: choice | |
description: Semantic Version Type | |
options: | |
- automatic | |
- patch | |
- minor | |
- major | |
jobs: | |
release-it: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: tibdex/github-app-token@v1 | |
id: generate-token | |
with: | |
app_id: ${{ secrets.RELEASE_BOT_APP_ID }} | |
private_key: ${{ secrets.RELEASE_BOT_APP_PRIVATE_KEY }} | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
# we need everything so release-it can compare the current version with the latest tag | |
fetch-depth: 0 | |
- name: initialize mandatory git config | |
run: | | |
git config user.name "GitHub Release Bot" | |
git config user.email release-bot@neolution.ch | |
- name: install @release-it/keep-a-changelog | |
run: npm install -g release-it @release-it/keep-a-changelog | |
- name: run release-it | |
run: | | |
params=() | |
if [[ ${{ github.event.inputs.version_type }} != "automatic" ]]; then | |
params+=(${{ github.event.inputs.version_type }}) | |
fi | |
if [[ ${{ github.event.inputs.pre_release }} != "stable" ]]; then | |
params+=(--preRelease=${{ github.event.inputs.pre_release }}) | |
params+=(--plugins.@release-it/keep-a-changelog.keepUnreleased) | |
params+=(--no-plugins.@release-it/keep-a-changelog.strictLatest) | |
fi | |
params+=(--ci) | |
echo "command: release-it ${params[@]}" | |
release-it "${params[@]}" | |
env: | |
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |