Snapshot release #995
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: Snapshot release | |
on: | |
workflow_call: | |
workflow_dispatch: | |
env: | |
NODE_OPTIONS: "--max-old-space-size=4096" | |
jobs: | |
release-snapshot: | |
name: Publish snapshot release to npm | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Set deployment token | |
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Check for pre.json file existence | |
id: check_files | |
uses: andstor/[email protected] | |
with: | |
files: ".changeset/pre.json" | |
# Remove this once https://github.com/changesets/changesets/issues/1195 is addressed | |
- name: Temporarily exit pre-release mode to release a snapshot | |
if: steps.check_files.outputs.files_exists == 'true' | |
run: pnpm changeset pre exit | |
- name: Clean | |
shell: bash | |
run: pnpm turbo run clean --force --concurrency 10 | |
# Build without cache to ensure we release with the most accurate output | |
- name: Build | |
shell: bash | |
run: pnpm turbo run build --force --concurrency 10 | |
# The changesets action doesn't support releasing snapshots (yet), | |
# so doing it manually here | |
- name: Publish snapshots | |
run: | | |
pnpm changeset version --snapshot ${{ github.ref_name }} | |
pnpm changeset publish --tag ${{ github.ref_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |