-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
35 lines (30 loc) · 1.06 KB
/
snapshot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Snapshot
on:
workflow_dispatch:
jobs:
snapshot:
name: Release snapshot version
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Publish Prerelease
if: steps.changesets.outputs.published != 'true'
continue-on-error: true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag=$(git branch --show-current | tr -cs '[:alnum:]-' '-' | tr '[:upper:]' '[:lower:]' | sed 's/-$//')
snapshot=$tag.$(date +'%Y%m%dT%H%M%S')
echo $tag
echo $snapshot
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
git reset --hard origin/main
pnpm clean
pnpm changeset version --no-git-tag --snapshot $snapshot
pnpm changeset:prepublish
# pnpm changeset publish --no-git-tag --snapshot $snapshot --tag $tag