Skip to content

Commit e6b06cf

Browse files
committed
Publish on merge to main
1 parent d6964bf commit e6b06cf

2 files changed

Lines changed: 54 additions & 41 deletions

File tree

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,57 @@ jobs:
3535

3636
- name: Build
3737
run: pnpm run build
38+
39+
publish:
40+
runs-on: ubuntu-latest
41+
needs: verify
42+
environment: deploy
43+
if: |
44+
github.event_name == 'push' &&
45+
github.ref == 'refs/heads/main' &&
46+
!contains(github.event.head_commit.message, '[skip ci]')
47+
48+
permissions:
49+
id-token: write # Required for OIDC
50+
contents: write
51+
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
with:
56+
fetch-depth: 0
57+
58+
- name: Setup pnpm
59+
uses: pnpm/action-setup@v4
60+
61+
- name: Setup node
62+
uses: actions/setup-node@v4
63+
with:
64+
node-version: 22
65+
cache: "pnpm"
66+
registry-url: "https://registry.npmjs.org"
67+
68+
- name: Install dependencies
69+
run: pnpm install
70+
71+
- name: Build
72+
run: pnpm run build
73+
74+
- name: Bump version, commit, and tag (patch +1)
75+
shell: bash
76+
run: |
77+
set -euo pipefail
78+
79+
git config --local user.email "kenneth.skovhus@gmail.com"
80+
git config --local user.name "skovhus"
81+
82+
pnpm version patch -m "chore(release): v%s [skip ci]"
83+
84+
- name: Push commit and tag
85+
shell: bash
86+
run: |
87+
set -euo pipefail
88+
git push origin HEAD:main --follow-tags
89+
90+
- name: Publish
91+
run: pnpm publish --no-git-checks

.github/workflows/publish.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)