Official release #8
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: Official release | |
on: | |
workflow_dispatch: # Manually on demand | |
inputs: | |
versionBump: | |
description: 'Type of version bump' | |
required: true | |
default: 'patch' | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
jobs: | |
publish-config: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
node: [20.x] # This should be LTS | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch the history, or this action won't work | |
- name: Use Node.js ${{ matrix.node }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Install dependencies | |
run: npm ci | |
- name: Test | |
run: npm test | |
- name: Prepare release | |
env: | |
VERSION_BUMP: ${{ inputs.versionBump }} | |
run: | | |
git config --global user.email "moritz.heusinger@gmail.com" | |
git config --global user.name "Github Action" | |
npm run release -- ${VERSION_BUMP} | |
- name: Determine the version bump | |
id: version | |
uses: actions/github-script@v7 | |
with: | |
result-encoding: string | |
script: | | |
const package = require('./package.json'); | |
return package.version | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.PR_TOKEN }} | |
commit-message: "[OFFICIAL RELEASE] ${{ steps.version.outputs.result }}" | |
committer: foxriver76 <moritz.heusinger@gmail.com> | |
author: foxriver76 <moritz.heusinger@gmail.com> | |
signoff: false | |
branch: official-release | |
delete-branch: true | |
title: "[OFFICIAL RELEASE] ${{ steps.version.outputs.result }}" | |
body: | | |
Update version by release action | |
labels: | | |
automated pr 🔧 | |
assignees: foxriver76 | |
draft: false |