Skip to content

A - Release Canary/Nightly #128

A - Release Canary/Nightly

A - Release Canary/Nightly #128

name: A - Release Canary/Nightly
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
publish:
name: Publish npm Packages
if: github.repository == 'rolldown/rolldown'
runs-on: ubuntu-latest
permissions:
contents: write # for softprops/action-gh-release@v1
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: 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: Canary/Nightly Versioning
run: node ./scripts/misc/bump-version.js snapshot
- name: Publish(Dry Run)
run: |
pnpm publish -r --tag ${{ needs.plan.outputs.npm-tag }} --dry-run --no-git-checks
env:
NPM_TOKEN: ${{ secrets.ROLLDOWN_NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
run: |
pnpm publish -r --tag ${{ needs.plan.outputs.npm-tag }} --no-git-checks
env:
NPM_TOKEN: ${{ secrets.ROLLDOWN_NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true