This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
68 lines (59 loc) · 1.86 KB
/
release-please.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
name: CD
on:
push:
branches: [main]
jobs:
release-please:
name: Create release PR
runs-on: ubuntu-latest
outputs:
release-created: ${{ steps.release.outputs.release_created }}
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: release-please-action
changelog-types: '[{"type":"feat","section":"What''s new"},{"type":"fix","section":"Fixes"}]'
path: packages/iTwinUI-react
publish:
name: Publish npm package
runs-on: ubuntu-latest
needs: release-please
if: needs.release-please.outputs.release-created
steps:
- uses: actions/checkout@v2
- name: Use Node 16.X
uses: actions/setup-node@v2
with:
node-version: 16.x
registry-url: https://registry.npmjs.org/
- run: yarn install
- run: yarn build
- run: npm publish --access public
working-directory: './packages/iTwinUI-react'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_ITWIN }}
fix-title:
name: Edit release title
runs-on: ubuntu-latest
needs: release-please
if: needs.release-please.outputs.release-created
steps:
- name: Update release title to match tag name
uses: actions/github-script@v4
with:
script: |
const { data: release } = await github.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
});
if (release.name !== release.tag_name) {
await github.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.id,
name: release.tag_name
});
}