-
Notifications
You must be signed in to change notification settings - Fork 152
51 lines (45 loc) · 1.54 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
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
- name: Node
uses: ./.github/actions/node
- name: Setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- 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 --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