-
Notifications
You must be signed in to change notification settings - Fork 21
62 lines (53 loc) · 2.3 KB
/
release-utils.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
name: Publish Sygma SDK Utilities package to GitHub Package Registry
on:
push:
branches: ["main"]
paths: ["packages/utils/**"]
jobs:
maybe-release:
name: release
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
# you should probably do this after your regular CI checks passes
# it will analyze commits and create PR with new version and updated CHANGELOG:md file. On merging it will create github release page with changelog
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
release-type: node
token: ${{secrets.RELEASE_TOKEN}}
config-file: "release-please/rp-utils-config.json"
manifest-file: "release-please/rp-utils-manifest.json"
monorepo-tags: true
default-branch: main
path: "packages/utils"
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false},{"type":"revert","hidden":true}]'
- uses: actions/checkout@v4
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.releases_created }}
- uses: actions/setup-node@v4
with:
cache: "yarn"
node-version: 18
registry-url: "https://registry.npmjs.org"
scope: "@buildwithsygma"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.releases_created }}
- name: Enable corepack
run: corepack enable
if: ${{ steps.release.outputs.releases_created }}
- name: Install dependencies
run: yarn install --immutable
if: ${{ steps.release.outputs.releases_created }}
- run: yarn build
if: ${{ steps.release.outputs.releases_created }}
- env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.releases_created }}
run: |
echo -e "\nnpmAuthToken: \"$NODE_AUTH_TOKEN\"" >> ./.yarnrc.yml
- run: yarn workspace @buildwithsygma/utils npm publish --access public
if: ${{ steps.release.outputs.releases_created }}