From d02741c9202bc42225c52a11dbce9efcc064d482 Mon Sep 17 00:00:00 2001 From: Gregor MacLennan Date: Tue, 17 Mar 2026 11:42:52 +0000 Subject: [PATCH] chore: add release workflow --- .github/workflows/release.yml | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b50ab4a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,57 @@ +name: release + +on: + workflow_dispatch: + inputs: + semver: + description: "The semver to use" + required: true + default: "auto" + type: choice + options: + - auto + - patch + - minor + - major + - prerelease + # - prepatch + # - preminor + # - premajor + pull_request: + types: [closed] + +jobs: + release: + if: >- + ${{ + ( + startsWith(github.event.inputs.semver, 'pre') || + github.ref == format( + 'refs/heads/{0}', + github.event.repository.default_branch + ) + ) && + ( + github.event_name != 'pull_request' || + github.event.pull_request.user.login == 'optic-release-automation[bot]' + ) + }} + runs-on: ubuntu-latest + permissions: + contents: write + issues: write + pull-requests: write + id-token: write + steps: + - uses: nearform-actions/optic-release-automation-action@a2785548e8bdafab7e628c2317b604278e460434 # v4.12.2 + with: + commit-message: "Release {version}" + sync-semver-tags: false + access: "public" + semver: ${{ github.event.inputs.semver }} + # Prereleases are published under the `next` npm dist-tag + npm-tag: ${{ startsWith(github.event.inputs.semver, 'pre') && 'next' || 'latest' }} + notify-linked-issues: false + publish-mode: oidc + build-command: | + npm ci