-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 1.81 KB
/
release-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
62
63
64
65
66
67
name: ✨ Release Publish
on:
push:
tags:
- v*.*
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref_name }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'yarn'
- name: yarn install
shell: bash
run: yarn --immutable
- name: build with ncc
shell: bash
run: yarn workspace kontinuous build
- name: prepublish
shell: bash
run: |
cp LICENSE README.md packages/kontinuous/
cat <<< $(jq "del(.dependencies, .devDependencies, .scripts, .main)" packages/kontinuous/package.json) > packages/kontinuous/package.json
- name: extract npm tag
id: npm-tag
shell: bash
run: |
if [[ "$GITHUB_REF" == *"alpha"* ]]; then
npm_tag="alpha"
elif [[ "$GITHUB_REF" == *"beta"* ]]; then
npm_tag="beta"
else
npm_tag="latest"
fi
echo "tag=$npm_tag" >> $GITHUB_OUTPUT
- id: publish-kontinuous
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.SOCIALGROOVYBOT_NPM_TOKEN }}
package: packages/kontinuous/package.json
tag: ${{ steps.npm-tag.outputs.tag }}
- if: steps.publish-kontinuous.outputs.type
run: |
echo "Version changed: ${{ steps.publish-kontinuous.outputs.old-version }} => ${{ steps.publish-kontinuous.outputs.version }}"
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
generate_release_notes: true