-
Notifications
You must be signed in to change notification settings - Fork 44
72 lines (58 loc) · 1.94 KB
/
fern.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: fern
on: push
defaults:
run:
# Enable fail-fast behavior
shell: bash -e {0}
jobs:
fern-check:
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Fern
run: npm install -g fern-api
- name: Check Fern API is valid
run: fern check
# TODO: Re-enable once https://github.com/fern-api/fern/pull/2551 is resolved
# - name: Verify generated code is up to date
# env:
# FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
# run: |
# ./scripts/fern/gen.sh
# git --no-pager diff --exit-code
fern-publish:
runs-on: ubuntu-20.04
needs:
- fern-check
steps:
# Only run on a tagged push
- name: Check Tag
id: check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
echo "match=true" >> $GITHUB_OUTPUT
fi
- name: Checkout repo
if: steps.check-tag.outputs.match == 'true'
uses: actions/checkout@v4
- name: Publish Full
if: steps.check-tag.outputs.match == 'true'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd sdks/full/typescript
npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"
yarn version --no-git-tag-version --new-version "${{ github.ref_name }}"
yarn pack --ignore-scripts -f archive.tgz
yarn publish --ignore-scripts archive.tgz
- name: Publish Runtime
if: steps.check-tag.outputs.match == 'true'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd sdks/runtime/typescript
npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"
yarn version --no-git-tag-version --new-version "${{ github.ref_name }}"
yarn pack --ignore-scripts -f archive.tgz
yarn publish --ignore-scripts archive.tgz