Skip to content

Manual Release

Manual Release #9

name: Manual Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
type: choice
required: true
default: fix
options:
- fix
- feat
- BREAKING CHANGE
dryRun:
description: 'DryRun'
type: boolean
default: true
# ENV and Config
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_NAME: github-actions
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: github-actions
GIT_COMMITTER_EMAIL: [email protected]
CI: true
CONFIG_NODE_VERSION: '["20.x"]'
CONFIG_OS: '["ubuntu-latest"]'
# Main Job
jobs:
config:
runs-on: ubuntu-latest
outputs:
NODE_VERSION: ${{ steps.set-config.outputs.CONFIG_NODE_VERSION }}
OS: ${{ steps.set-config.outputs.CONFIG_OS }}
steps:
- id: set-config
run: |
echo "CONFIG_NODE_VERSION=${{ toJSON(env.CONFIG_NODE_VERSION) }}" >> $GITHUB_OUTPUT
echo "CONFIG_OS=${{ toJSON(env.CONFIG_OS) }}" >> $GITHUB_OUTPUT
release:
name: Test, Build and force Release
needs: config
runs-on: ${{ matrix.OS }}
strategy:
matrix:
OS: ${{ fromJSON(needs.config.outputs.OS) }}
NODE_VERSION: ${{ fromJSON(needs.config.outputs.NODE_VERSION) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.NODE_VERSION }}
- name: Commit trigger
run: |
git commit --allow-empty -m "${{ github.event.inputs.version }}: Trigger Manual Release
${{ github.event.inputs.version }}:Forced Manual Release without code changes"
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Build Library
run: npm run build --workspaces --if-present
- name: Run Tests
run: npm test --workspaces --if-present
- name: Prepare release
run: DRY_RUN=${{ github.event.inputs.dryRun == 'true' }} node release/prepareModule.js
- name: Release
run: npm run release --workspaces