-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (49 loc) · 1.39 KB
/
publish.yml
File metadata and controls
56 lines (49 loc) · 1.39 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
name: Publish
on:
workflow_dispatch:
push:
branches:
- "main"
permissions:
contents: write
id-token: write
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
publish-all:
name: Publish all packages
runs-on: ubuntu-latest
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Install dependencies
run: yarn install --immutable
- name: Verify
run: yarn verify
- name: Check changesets
id: check
run: |
count=$(find .changeset -name "*.md" | wc -l | tr -d '[:space:]')
if [[ $count == 0 ]]; then
echo "hasChangesets=false" >> $GITHUB_OUTPUT;
else
echo "hasChangesets=true" >> $GITHUB_OUTPUT;
fi
- name: Publish
if: ${{ steps.check.outputs.hasChangesets == 'true' }}
continue-on-error: true
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
yarn publish
- name: Push changes
if: ${{ steps.check.outputs.hasChangesets == 'true' }}
run: |
git status
git push origin
git push origin --tags