ci: Don't move tags by default #789
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: Pre-Release | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
move-tags: | |
default: false | |
description: Allow tags to be moved? Requires GitHub Release. | |
required: false | |
type: boolean | |
publish-documentation: | |
default: false | |
description: Update the documentation website? | |
required: false | |
type: boolean | |
publish-github-release: | |
default: false | |
description: Create a GitHub release? | |
required: false | |
type: boolean | |
publish-npm: | |
default: false | |
description: Publish npm package? | |
type: boolean | |
required: false | |
publish-oci: | |
default: false | |
description: Publish container? | |
type: boolean | |
required: false | |
release-tag: | |
default: dev | |
description: Floating pre-release tag to use. | |
type: string | |
required: true | |
concurrency: | |
group: pre-release | |
cancel-in-progress: false | |
env: | |
# renovate: datasource=node-version depName=node versioning=node | |
NODE_VERSION: "22.14.0" | |
jobs: | |
params: | |
name: Determine configuration | |
outputs: | |
move-tags: ${{ github.event_name == 'workflow_dispatch' && inputs.move-tags || false }} | |
publish-documentation: ${{ github.event_name == 'workflow_dispatch' && inputs.publish-documentation || false }} | |
publish-github-release: ${{ github.event_name == 'workflow_dispatch' && inputs.publish-github-release || false }} | |
publish-npm: ${{ github.event_name == 'workflow_dispatch' && inputs.publish-npm || false }} | |
publish-oci: ${{ github.event_name == 'workflow_dispatch' && inputs.publish-oci || false }} | |
release-tag: ${{ github.event_name == 'workflow_dispatch' && inputs.release-tag || 'dev' }} | |
release-channel: dev | |
permissions: | |
contents: none | |
runs-on: ubuntu-24.04 | |
steps: | |
- if: false | |
name: Noop | |
run: exit 0 | |
changelog: | |
name: Changelog | |
needs: | |
- params | |
outputs: | |
major: ${{ steps.changelog.outputs.major-total }} | |
minor: ${{ steps.changelog.outputs.minor-total }} | |
patch: ${{ steps.changelog.outputs.patch-total }} | |
lifecycle: ${{ steps.changelog.outputs.lifecycle-total }} | |
version: ${{ steps.changelog.outputs.version-dev-extended }} | |
permissions: | |
contents: read | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
persist-credentials: false | |
sparse-checkout: | | |
package.json | |
sparse-checkout-cone-mode: false | |
- id: version | |
name: Extract current version | |
run: | | |
echo "root-version=$(jq --raw-output '.version' package.json)" >> $GITHUB_OUTPUT | |
- name: Generate Changelog | |
id: changelog | |
uses: oliversalzburg/action-automatic-semantic-releases@db96c81b334bf45a3e971b5d46ee6b63d523a472 # v0.5.6 | |
with: | |
automatic-release-tag: ${{ needs.params.outputs.release-tag }} | |
changelog-artifact: changelog.json | |
dry-run: true | |
publish: false | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
root-version: ${{ steps.version.outputs.root-version }} | |
- name: Store Changelog | |
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4 | |
with: | |
name: changelog.json | |
path: changelog.json | |
qa: | |
name: 🔹 QA | |
uses: ./.github/workflows/qa.yml | |
pre-release: | |
name: Pre-Release | |
needs: | |
- changelog | |
- params | |
- qa | |
permissions: | |
actions: write | |
attestations: write | |
contents: write | |
id-token: write | |
packages: write | |
pull-requests: read | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
persist-credentials: false | |
- name: Select Node.js version | |
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
registry-url: https://registry.npmjs.org | |
- name: Enable Corepack | |
run: | | |
corepack enable | |
yarn config set enableGlobalCache false | |
- name: Load cached dependencies | |
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4 | |
with: | |
path: .yarn/cache | |
key: ${{ runner.os }}-node${{ env.NODE_VERSION }}-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-node${{ env.NODE_VERSION }} | |
- name: Build release | |
env: | |
RELEASE_VERSION: ${{ needs.changelog.outputs.version }} | |
run: | | |
make devcontainer injectable userscript | |
- name: Download changelog | |
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4 | |
with: | |
name: changelog.json | |
- if: success() && ${{ needs.params.outputs.publish-github-release }} | |
name: Generate GitHub release | |
uses: oliversalzburg/action-automatic-semantic-releases@db96c81b334bf45a3e971b5d46ee6b63d523a472 # v0.5.6 | |
with: | |
automatic-release-tag: ${{ needs.params.outputs.release-tag }} | |
changelog-artifact: changelog.json | |
draft: true | |
dry-run: ${{ needs.params.outputs.move-tags == false }} | |
files: | | |
output/* | |
merge-similar: true | |
prerelease: true | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
title: Development Build v${{ needs.changelog.outputs.version }} | |
with-authors: false | |
update-release-info: | |
# The Release Info action uses GitHub releases as source of truth. | |
# If we didn't publish a release, there is no need to update the information. | |
if: success() && needs.params.outputs.publish-github-release | |
name: 🔹 Update Release Info | |
needs: | |
- params | |
- pre-release | |
permissions: | |
contents: read | |
id-token: write | |
uses: ./.github/workflows/release-info.yml | |
deploy-documentation: | |
if: success() && needs.params.outputs.publish-documentation | |
name: 🔹 Deploy Documentation | |
needs: | |
- params | |
- pre-release | |
permissions: | |
contents: read | |
id-token: write | |
uses: ./.github/workflows/documentation-deploy.yml | |
publish-devcontainer: | |
if: success() && needs.params.outputs.publish-oci | |
name: 🔹 Publish Devcontainer | |
needs: | |
- params | |
- pre-release | |
permissions: | |
attestations: write | |
contents: read | |
id-token: write | |
packages: write | |
pages: write | |
pull-requests: read | |
security-events: write | |
uses: oliversalzburg/workflows/.github/workflows/publish-oci.yml@main | |
with: | |
artifact-name: devcontainer-output | |
containerfile: container/Containerfile | |
image-description: Kitten Science Development Container | |
image-name: kitten-science/devcontainer | |
image-tag: ${{ needs.params.outputs.release-tag }} | |
image-title: devcontainer | |
is-latest: false | |
push: true | |
publish-npm: | |
if: success() && needs.params.outputs.publish-npm | |
name: 🔹 Publish npm | |
needs: | |
- changelog | |
- params | |
- pre-release | |
permissions: | |
contents: write | |
id-token: write | |
packages: write | |
pages: write | |
pull-requests: read | |
secrets: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
uses: oliversalzburg/workflows/.github/workflows/frag-publish-npm.yml@main | |
with: | |
is-canary: true | |
npm-dist-tag: ${{ needs.params.outputs.release-tag }} | |
version: ${{ needs.changelog.outputs.version }} |