-
Notifications
You must be signed in to change notification settings - Fork 5
60 lines (54 loc) · 1.62 KB
/
publish-core-on-merge.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
name: Publish bumpgen core to npmjs
on:
push:
branches: [main]
paths:
- "packages/bumpgen-core/**"
jobs:
check:
name: "Check if release is needed"
runs-on: "ubuntu-latest"
outputs:
exists: ${{ steps.check-tag.outputs.exists }}
steps:
- uses: actions/checkout@v4
- uses: martinbeentjes/npm-get-version-action@main
id: get-version
- uses: mukunku/[email protected]
id: check-tag
with:
tag: v${{ steps.get-version.outputs.current-version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: "Release"
needs: check
if: needs.check.outputs.exists == 'false'
runs-on: "ubuntu-latest"
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: martinbeentjes/npm-get-version-action@main
id: get-version
- uses: actions/create-release@v1
id: create-release
with:
draft: false
prerelease: false
release_name: v${{ steps.get-version.outputs.current-version}}
tag_name: v${{ steps.get-version.outputs.current-version}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./tooling/github/setup
- run: pnpm install --frozen-lockfile
- run: pnpm --filter=@xeol/bumpgen-core run build
- run: pnpm --filter=@xeol/bumpgen-core publish --tag latest --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}