-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (39 loc) · 1.38 KB
/
publish-template-resolver.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
name: Publish Template Resolver Package
on:
push: {}
release:
types:
- published
env:
PACKAGE_NAME: "@fern-api/template-resolver"
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: "buildwithfern"
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
GITHUB_TOKEN: ${{ secrets.FERN_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.FERN_NPM_TOKEN }}
jobs:
publish_package:
if: github.event_name == 'release' && startsWith(github.event.release.tag_name, 'template-resolver@')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 📥 Install
uses: ./.github/actions/install
- name: 🧪 Build and test
run: pnpm turbo codegen build test --filter=${{ env.PACKAGE_NAME }}
- name: 🧪 Build CJS and test
run: pnpm --filter=${{ env.PACKAGE_NAME }} compile:cjs
- name: Publish Template Resolver Package
env:
NPM_TOKEN: ${{ secrets.FERN_NPM_TOKEN }}
# Currently follows the same version as FDR, which is probably fine for now
run: |
tag=${{ github.event.release.tag_name }}
prefix="template-resolver@"
VERSION="${tag#$prefix}"
cd packages/template-resolver
node preparePackageJson.cjs $VERSION
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
npm publish --access public