Skip to content

Nightly

Nightly #275

Workflow file for this run

name: Nightly
on:
schedule:
- cron: "30 2 * * *"
workflow_dispatch:
inputs:
move-tags:
default: false
description: Allow tags to be moved? Requires GitHub Release.
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
release-tag:
default: nightly
description: Floating pre-release tag to use.
type: string
required: true
concurrency:
group: nightly
cancel-in-progress: false
env:
# renovate: datasource=node-version depName=node versioning=node
NODE_VERSION: "24.13.0"
jobs:
params:
name: Determine configuration
outputs:
move-tags: ${{ github.event_name == 'workflow_dispatch' && inputs.move-tags || 'true' }}
publish-github-release: ${{ github.event_name == 'workflow_dispatch' && inputs.publish-github-release || 'true' }}
publish-npm: ${{ github.event_name == 'workflow_dispatch' && inputs.publish-npm || 'true' }}
release-tag: ${{ github.event_name == 'workflow_dispatch' && inputs.release-tag || 'nightly' }}
release-channel: nightly
permissions:
contents: none
runs-on: ubuntu-24.04
steps:
- if: false
name: Noop
run: exit 0
changelog:
name: Changelog
needs:
- params
outputs:
has-changed: ${{ 0 < steps.changelog.outputs.major-total || 0 < steps.changelog.outputs.minor-total || 0 < steps.changelog.outputs.patch-total }}
version: ${{ steps.changelog.outputs.version-patch-extended-nightly }}
permissions:
contents: read
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
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
- id: changelog
name: Generate changelog
uses: oliversalzburg/action-automatic-semantic-releases@85df1a5f81e6a18f5bb88eb495198b27399066dc # v2.0.0
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@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: changelog.json
path: changelog.json
skip:
if: success() && needs.changelog.outputs.has-changed == 'false'
name: Skip
needs:
- changelog
runs-on: ubuntu-24.04
steps:
- name: Print skip reason
run: echo "No behavior changes since the last nightly were detected."
qa:
if: success() && needs.changelog.outputs.has-changed == 'true'
name: 🔹 QA
needs:
- changelog
uses: ./.github/workflows/qa.yml
publish-npm:
if: success() && needs.params.outputs.publish-npm == 'true' && needs.changelog.outputs.has-changed == 'true'
name: 🔹 Publish
needs:
- changelog
- params
- qa
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:
dist-tag: ${{ needs.params.outputs.release-tag }}
version: ${{ needs.changelog.outputs.version }}
nightly:
if: |
always()
&& contains(needs.*.result, 'success')
&& !contains(needs.*.result, 'failure')
&& needs.params.outputs.publish-github-release == 'true'
&& needs.changelog.outputs.has-changed == 'true'
name: Nightly
needs:
- changelog
- params
- publish-npm
- 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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
with:
persist-credentials: false
- name: Select Node.js version
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
- name: Load cached dependencies
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with:
path: ~/.npm
key: ${{ runner.os }}-node{{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node${{ env.NODE_VERSION }}
- name: Build release
env:
RELEASE_CHANNEL: ${{ needs.params.outputs.release-channel }}
RELEASE_VERSION: ${{ needs.changelog.outputs.version }}
run: make
- name: Download changelog
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with:
name: changelog.json
- name: Generate GitHub release
uses: oliversalzburg/action-automatic-semantic-releases@85df1a5f81e6a18f5bb88eb495198b27399066dc # v2.0.0
with:
automatic-release-tag: ${{ needs.params.outputs.release-tag }}
body-suffix: |
---
- Release generated by <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>
${{ needs.publish-npm.outputs.publish-url && format('- npm package published at <{0}>', needs.publish-npm.outputs.publish-url) }}
changelog-artifact: changelog.json
draft: false
dry-run: ${{ needs.params.outputs.move-tags == 'false' }}
merge-similar: true
prerelease: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
title: Nightly Build v${{ needs.changelog.outputs.version }}
with-authors: false