-
Notifications
You must be signed in to change notification settings - Fork 11
54 lines (52 loc) · 2.06 KB
/
Copy pathlibrary-release.yml
File metadata and controls
54 lines (52 loc) · 2.06 KB
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
name: Library Release
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Setup
uses: aragon/gov-ui-kit/.github/actions/setup@main
with:
token: ${{ secrets.ARABOT_PAT_TRIGGER_WORKFLOW }}
- name: Setup Git config
run: |
git config --global user.name "Arabot-1"
git config --global user.email "arabot-1@users.noreply.github.com"
- name: Update version and changelog
# Run prettier on CHANGELOG.md file (used for Github release notes) to remove automatic formatting applied by
# changeset as Github does not support soft line breaks.
# (See https://github.com/changesets/changesets/issues/1452, https://github.com/orgs/community/discussions/10981)
run: |
yarn changeset version
yarn prettier --write CHANGELOG.md --print-width 9999999 --ignore-path
env:
GITHUB_TOKEN: ${{ secrets.ARABOT_PAT_TRIGGER_WORKFLOW }}
- name: Create tag
run: yarn changeset tag
- name: Get package version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: Commit changes
run: |
git add --all
git commit -am "Publish v${{ steps.package-version.outputs.current-version}}"
git push --follow-tags
- name: Read changelog updates
id: read-changelog
uses: actions/github-script@v7.0.1
env:
version: "${{ steps.package-version.outputs.current-version }}"
path: ./CHANGELOG.md
with:
script: |
const readChangelog = require('./.github/workflows/scripts/readChangelog.js');
readChangelog({ github, context, core });
- name: Create release
uses: softprops/action-gh-release@v2.3.2
with:
prerelease: false
tag_name: "v${{ steps.package-version.outputs.current-version}}"
body: ${{ steps.read-changelog.outputs.changes }}
token: ${{ secrets.ARABOT_PAT_TRIGGER_WORKFLOW }}