Skip to content

Release

Release #11

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
specifier:
description: 'Version bump level (auto = conventional commits)'
type: choice
options:
- auto
- patch
- minor
- major
- premajor
- preminor
- prepatch
- prerelease
default: auto
dry_run:
description: 'Dry run (preview changes without publishing)'
required: false
default: false
type: boolean
first_release:
description: 'First release (no previous git tag exists yet)'
required: false
default: false
type: boolean
publish:
description: 'Publish packages to npm after releasing'
required: false
default: false
type: boolean
publish_gpr:
description: 'Publish packages to GitHub Packages after releasing'
required: false
default: false
type: boolean
publish_docker:
description: 'Build and push Docker image after releasing'
required: false
default: false
type: boolean
jobs:
release:
name: Version, Changelog & Tag
runs-on: ubuntu-latest
permissions:
contents: write # needed to push commits and tags
id-token: write # needed for provenance data generation
timeout-minutes: 15
outputs:
tag: ${{ steps.get_tag.outputs.tag }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org/
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.2.9
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Install dependencies
run: bun install
- name: Print Environment Info
run: npx nx report
shell: bash
- name: Version, changelog & tag (dry run)
if: ${{ inputs.dry_run }}
run: npx nx release ${{ inputs.specifier != 'auto' && inputs.specifier || '' }} --verbose --dry-run ${{ inputs.first_release && '--first-release' || '' }}
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Version, changelog & tag
if: ${{ !inputs.dry_run }}
run: npx nx release ${{ inputs.specifier != 'auto' && inputs.specifier || '' }} --verbose --skip-publish ${{ inputs.first_release && '--first-release' || '' }}
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push commit and tags
if: ${{ !inputs.dry_run }}
run: |
git push origin HEAD:main
git push --tags
- name: Get latest tag
id: get_tag
if: ${{ !inputs.dry_run }}
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
publish:
name: Publish packages
needs: release
if: ${{ !inputs.dry_run && inputs.publish }}
uses: ./.github/workflows/publish.yml
with:
version: ${{ needs.release.outputs.tag }}
permissions:
contents: read
id-token: write
publish-gpr:
name: Publish packages to GitHub Packages
needs: release
if: ${{ !inputs.dry_run && inputs.publish_gpr }}
uses: ./.github/workflows/publish-gpr.yml
with:
version: ${{ needs.release.outputs.tag }}
permissions:
contents: read
packages: write
docker:
name: Build and push Docker image
needs: release
if: ${{ !inputs.dry_run && inputs.publish_docker }}
uses: ./.github/workflows/docker.yml
with:
version: ${{ needs.release.outputs.tag }}
permissions:
contents: read
packages: write