-
Notifications
You must be signed in to change notification settings - Fork 39
45 lines (38 loc) · 1.29 KB
/
snapshot.yml
File metadata and controls
45 lines (38 loc) · 1.29 KB
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
36
37
38
39
40
41
42
43
44
45
name: Snapshot
permissions:
contents: read
on:
workflow_call:
workflow_dispatch:
jobs:
snapshot:
name: Release snapshot version
permissions:
contents: write
id-token: write
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Publish Initial Versions for New Packages
continue-on-error: false
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
node .github/scripts/publish-initial-versions.js
- name: Publish Snapshots
continue-on-error: false
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
snapshot=$(git branch --show-current | tr -cs '[:alnum:]-' '-' | tr '[:upper:]' '[:lower:]' | sed 's/-$//')
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
yarn run changeset version --no-git-tag --snapshot $snapshot
yarn run changeset:prepublish:ci
yarn run changeset publish --no-git-tag --snapshot $snapshot --tag $snapshot