-
Notifications
You must be signed in to change notification settings - Fork 1.4k
55 lines (45 loc) · 1.45 KB
/
publish-to-next.yaml
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
46
47
48
49
50
51
52
53
54
55
name: "Publish to `pr` or `next` tag"
on:
pull_request:
push:
branches:
- master
concurrency: ${{ github.workflow }}-${{ github.ref }}
env:
# NPM_DIST_TAG: github.ref_name == 'master' ? 'next' : 'pr-${{ github.event.pull_request.number }}'
NPM_DIST_TAG: next
jobs:
publish-to-github-packages:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: CI Setup
uses: ./.github/actions/ci-setup
- name: Build
run: pnpm build
- name: Create .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN
@FuelLabs:registry=https://npm.pkg.github.com
EOF
env:
HOME: ${{ github.workspace }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish `$NPM_DIST_TAG` tag on GitHub Packages
run: |
git checkout master
pnpm changeset:next
pnpm changeset version --snapshot $NPM_DIST_TAG
pnpm changeset publish --tag $NPM_DIST_TAG
env:
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOME: ${{ github.workspace }}
npm_config_registry: "https://npm.pkg.github.com"