Repository navigation
62 lines (53 loc) · 1.92 KB
/
Copy pathrelease.yml
File metadata and controls
62 lines (53 loc) · 1.92 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
55
56
57
58
59
60
61
62
name: Release
on:
push:
branches:
- main
jobs:
release:
if: github.repository == 'toss/react-simplikit'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- name: Checkout Repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Enable Corepack
run: corepack enable
- name: Install Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
- name: Install Dependencies
run: yarn install
- name: Build
run: yarn run prepack
- name: Type Check
run: yarn run test:type
# v2.1.1, not v2.1.0: v2.1.0 ignores `commit-message` due to a typo.
# Publishing goes through `yarn npm publish` (changesets v3 + Yarn Berry), so
# provenance is Yarn's setting; `NPM_CONFIG_PROVENANCE` would be ignored.
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2
with:
pr-title: 'chore: version packages'
commit-message: 'chore: version packages'
version-script: yarn run changeset:version
publish-script: yarn run changeset:publish
env:
YARN_NPM_PUBLISH_PROVENANCE: true
- name: Summarize published packages
if: steps.changesets.outputs.published == 'true'
env:
PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.published-packages }}
run: |
{
echo "## Published to npm"
echo
echo "$PUBLISHED_PACKAGES" | jq -r '.[] | "- [\(.name)@\(.version)](https://www.npmjs.com/package/\(.name)/v/\(.version))"'
} >> "$GITHUB_STEP_SUMMARY"