-
Notifications
You must be signed in to change notification settings - Fork 152
61 lines (54 loc) · 1.92 KB
/
publish.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
name: Publish
on:
workflow_dispatch:
inputs:
dryrun:
description: "Dry run"
required: false
default: false
type: boolean
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write # create commits and releases
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch tags
token: ${{ secrets.PAT }}
- name: Node
uses: ./.github/actions/node
- name: Setup git config
run: |
git config user.name "mainframev"
git config user.email "[email protected]"
- name: Build
run: |
# we need to build packages in the right order
# lerna won't run build due to --ignore-prepublish flag
yarn tokens build
yarn tailwind-preset build
yarn components build
yarn workspace @kiwicom/eslint-plugin-orbit-components build
- name: Dry run
if: ${{ github.event.inputs.dryrun == 'true' }}
run: |
yarn lerna version --no-private --no-push --no-git-tag-version --yes
git diff
yarn zx scripts/post-changelog.mjs --dry
- name: Publish
if: ${{ github.event.inputs.dryrun == 'false' }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # must be of type Automation to create releases
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "scope=@kiwicom" > ~/.npmrc
echo "access=public" >> ~/.npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
echo "//registry.npmjs.org/:always-auth=true" >> ~/.npmrc
yarn lerna publish --no-private --conventional-commits --create-release github --ignore-prepublish --yes
yarn docs changelog
git add docs/src/data/log.md && git commit -m "docs: update changelog" && git push
yarn zx scripts/post-changelog.mjs