Create Release #115
This file contains hidden or 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: | |
| versioning_phase: | |
| type: choice | |
| description: Versioning Phase | |
| default: stable | |
| options: | |
| - alpha | |
| - beta | |
| - rc | |
| - stable | |
| bump_version_number: | |
| type: choice | |
| description: Bump Version Number | |
| default: consecutive | |
| options: | |
| - consecutive | |
| - patch | |
| - minor | |
| - major | |
| is_dry_run: | |
| type: boolean | |
| description: Dry Run | |
| jobs: | |
| release-it: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: tibdex/github-app-token@v2 | |
| id: generate-token | |
| with: | |
| app_id: ${{ secrets.RELEASE_BOT_APP_ID }} | |
| private_key: ${{ secrets.RELEASE_BOT_APP_PRIVATE_KEY }} | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| 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 with plugins | |
| run: npm install -g release-it@16.3.0 @release-it/keep-a-changelog@2.1.0 | |
| - name: Check Node.js version | |
| run: | | |
| node --version | |
| npm --version | |
| echo "=== PACKAGE.JSON DEBUG ===" | |
| if [ -f package.json ]; then | |
| echo "package.json exists:" | |
| cat package.json | |
| else | |
| echo "No package.json found" | |
| fi | |
| echo "=== RELEASE-IT CONFIG DEBUG ===" | |
| if [ -f .release-it.json ]; then | |
| echo ".release-it.json contents:" | |
| cat .release-it.json | |
| else | |
| echo "No .release-it.json found" | |
| fi | |
| echo "================================" | |
| - name: run release-it | |
| run: | | |
| echo "=== WORKFLOW INPUTS DEBUG ===" | |
| echo "bump_version_number: '${{ github.event.inputs.bump_version_number }}'" | |
| echo "versioning_phase: '${{ github.event.inputs.versioning_phase }}'" | |
| echo "is_dry_run: '${{ github.event.inputs.is_dry_run }}'" | |
| echo "GITHUB_TOKEN (first 10 chars): ${GITHUB_TOKEN:0:10}..." | |
| echo "Node.js version: $(node --version)" | |
| echo "release-it version: $(release-it --version)" | |
| echo "================================" | |
| params=() | |
| if [[ ${{ github.event.inputs.bump_version_number }} != "consecutive" ]]; then | |
| params+=(${{ github.event.inputs.bump_version_number }}) | |
| fi | |
| if [[ ${{ github.event.inputs.versioning_phase }} != "stable" ]]; then | |
| params+=(--preRelease=${{ github.event.inputs.versioning_phase }}) | |
| fi | |
| if [[ ${{ github.event.inputs.is_dry_run }} == "true" ]]; then | |
| params+=(--dry-run) | |
| fi | |
| params+=(--ci) | |
| params+=(--verbose) | |
| echo "=== RELEASE-IT EXECUTION ===" | |
| echo "command: release-it ${params[@]}" | |
| echo "Working directory: $(pwd)" | |
| echo "Git status:" | |
| git status --porcelain | |
| echo "Git tags (last 5):" | |
| git tag --sort=-version:refname | head -5 | |
| echo "================================" | |
| release-it "${params[@]}" | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |