Skip to content

Publish Nightly/Canary #8

Publish Nightly/Canary

Publish Nightly/Canary #8

name: Publish Nightly/Canary
on:
# Manually released. This will publish under the canary npm tag.
workflow_dispatch:
# Every day at midnight. This will publish under the nightly npm tag.
schedule:
- cron: '0 0 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
plan:
name: Plan release
if: github.repository == 'rolldown/rolldown'
runs-on: ubuntu-latest
outputs:
npm-tag: ${{ github.event_name == 'schedule' && 'nightly' || 'canary' }}
steps:
- run: 'echo "Planning release"'
build:
name: Build bindings and node packages
if: github.repository == 'rolldown/rolldown'
uses: ./.github/workflows/reusable-release-build.yml
with:
version: 'commit'
publish:
name: Publish npm Packages
if: github.repository == 'rolldown/rolldown'
runs-on: ubuntu-latest
permissions:
id-token: write # for `npm publish --provenance`
needs:
- plan
- build
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Git Reset Hard
run: git reset --hard # fix pnpm install add new line for package.json
- name: Download Binding Artifacts
uses: actions/download-artifact@v4
with:
path: packages/rolldown/artifacts
- name: Move Binding Artifacts
run: pnpm --filter rolldown artifacts
- name: List Rolldown Bindings
run: ls -R ./packages/rolldown/npm
shell: bash
- name: Download Node Artifacts
uses: actions/download-artifact@v4
with:
path: packages/rolldown/dist
name: node-artifact
- name: Download `rolldown-version.txt`
uses: actions/download-artifact@v4
with:
name: rolldown-version
- name: Read `rolldown-version.txt`
id: rolldown-version
uses: igorskyflyer/action-readfile@v1.0.0
with:
path: rolldown-version.txt
- name: Canary/Nightly Versioning
run: node ./scripts/misc/bump-version.js ${{ steps.rolldown-version.outputs.content }}
- name: Copy Licenses
run: |
find ./packages/ -type d -maxdepth 1 -exec cp LICENSE {} \;
find ./packages/ -type d -maxdepth 1 -exec cp THIRD-PARTY-LICENSE {} \;
- name: Set Publishing Config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.ROLLDOWN_NPM_TOKEN }}
- name: Publish
run: node ./scripts/ci/publish-rolldown-to-npm.js ${{ needs.plan.outputs.npm-tag }}
env:
NPM_CONFIG_PROVENANCE: true # https://github.com/pnpm/pnpm/issues/6435