-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (75 loc) · 2.85 KB
/
release-got-api.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: release-got-api
on:
push:
tags:
- 'packages/got-api/v*.*.*'
- '!v*.*.*-**'
env:
# THIS GITHUB_TOKEN IS A REQUIREMENT TO BE ABLE TO WRITE TO GH RELEASES
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# IF YOU NEED TO PUBLISH A NPM PACKAGE THEN ENSURE A NPM_TOKEN SECRET IS SET
# AND PUBLISH_NPM: TRUE. IF YOU WANT TO PUBLISH TO A PRIVATE NPM REGISTRY
# THEN ENSURE THE NPM_REGISTRY_URL IS CHANGED
# NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
PUBLISH_NPM: true
NPM_REGISTRY_URL: https://registry.npmjs.org
jobs:
publish:
name: Publish SDKs
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Unshallow clone for tags
run: git fetch --tags --force
- name: Check worktree clean
working-directory: ./packages/got-api
run: |
git update-index -q --refresh
if ! git diff-files --quiet; then
>&2 echo "error: working tree is not clean, aborting!"
git status
git diff
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: ${{env.NPM_REGISTRY_URL}}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Bun
uses: oven-sh/setup-bun@v1
# - name: Set version to release tag
# working-directory: ./packages/got-api
# shell: bash
# run: pnpm version from-git --no-commit-hooks --no-git-tag-version --allow-same-version
- name: Install
shell: bash
run: pnpm install
- name: Build
working-directory: ./packages/got-core
shell: bash
run: pnpm build
- name: Build Api
working-directory: ./packages/got-api
shell: bash
run: pnpm build
- name: Publish
working-directory: ./packages/got-api
shell: bash
run: pnpm publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
# - name: Push version changes to main branch
# uses: stefanzweifel/git-auto-commit-action@v5
# with:
# commit_message: 'chore: release ${{ github.event.release.tag_name }}'
# branch: ${{ github.event.repository.default_branch }}
# file_pattern: packages/got-api/package.json
strategy:
fail-fast: true