Skip to content

Commit

Permalink
cicd: add snapshot release automation
Browse files Browse the repository at this point in the history
  • Loading branch information
chmanie committed Mar 18, 2024
1 parent a84fb1d commit e5c3d23
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release a snapshot

on:
push:
branches:
- next

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.10.0]
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8.14.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: pnpm run bootstrap
- name: Publish snapshot to npm
run: pnpm run version-snapshot && pnpm run release-snapshot
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_OPTIONS: --max-old-space-size=4096
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
"lint": "pnpm -r lint",
"no-git-changes": "./scripts/no-git-changes.sh",
"prepare": "husky install",
"release": "pnpm run lint && pnpm run build && pnpm run test && pnpm run no-git-changes && changeset publish",
"prerelase": "pnpm run lint && pnpm run build && pnpm run test && pnpm run no-git-changes",
"release": "pnpm run prerelease && changeset publish",
"release-snapshot": "pnpm run prerelease && changeset publish --no-git-tag --snapshot",
"version": "changeset version && pnpm install --lockfile-only",
"version-snapshot": "changeset version --snapshot next && pnpm install --lockfile-only",
"test": "pnpm -r test",
"typecheck": "pnpm -r typecheck"
},
Expand Down

0 comments on commit e5c3d23

Please sign in to comment.