-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.49 KB
/
release.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Release
on:
push:
branches:
- main
- next
permissions: write-all
jobs:
unit_tests:
name: Unit tests
uses: ./.github/workflows/unit_tests.yml
release:
name: Release
runs-on: ubuntu-latest
needs: unit_tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup (cache, dependencies)
uses: ./.github/actions/install_and_cache_dependencies
- name: Build
run: pnpm build
# For stable branch, use changeset action to maintain a PR and finally
# publish when appropriate.
- name: Create release (or Pull Request)
if: github.ref_name == 'main'
uses: changesets/action@v1
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
publish: pnpm release
# Snapshot releases don't need the changeset action to put together PRs.
- name: Create snapshot release
if: github.ref_name == 'next'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
pnpm build
pnpm changeset version --snapshot next
pnpm changeset publish --tag next
# - name: Release
# env:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.TELLUS_ACCESS_TOKEN }}
# run: pnpm semantic-release