-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (53 loc) · 1.65 KB
/
publish.yaml
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
name: Publish
on:
workflow_dispatch:
inputs:
target_element:
description: 'Semver element will be incremented'
required: true
default: patch
type: choice
options:
- major
- minor
- patch
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Configure git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
- name: Bump version
run: |
npm version ${{ inputs.target_element }} \
--include-workspace-root \
--no-git-tag-version \
-w packages/bolt-s3 \
-w packages/bolt-dynamodb
- name: Get version string
id: get-version-string
run: echo "version=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT"
- run: |
git add \
package.json \
package-lock.json \
packages/bolt-s3/package.json \
packages/bolt-dynamodb/package.json
- run: git commit -m "v${{ steps.get-version-string.outputs.version }}"
- run: git tag "v${{ steps.get-version-string.outputs.version }}"
- run: npm ci
- run: make publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: git push
- run: git push origin "v${{ steps.get-version-string.outputs.version }}"