Skip to content

Commit 7d364c3

Browse files
committed
chore: add release please
1 parent eff2ac5 commit 7d364c3

2 files changed

Lines changed: 37 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v4
10+
with:
11+
# use a token so we trigger release-please if needed
12+
token: ${{ secrets.BOT_GITHUB_TOKEN }}
1013
- name: Setup Node
1114
uses: actions/setup-node@v4
1215
with:
@@ -16,7 +19,6 @@ jobs:
1619
- name: Build TypeScript
1720
run: npm run build
1821
- name: Commit build changes
19-
id: current_sha
2022
if: ${{ github.ref == 'refs/heads/main' }}
2123
run: |
2224
git config --local user.name "github-actions[bot]"
@@ -25,6 +27,6 @@ jobs:
2527
if git diff --cached --quiet HEAD; then
2628
echo "No changes to commit."
2729
else
28-
git commit -m "chore(build): Update dist [skip ci]"
30+
git commit -m "chore(build): Update dist"
31+
git push
2932
fi
30-
echo "current_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- next
8+
9+
jobs:
10+
release-please:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: googleapis/release-please-action@v4
15+
id: release
16+
with:
17+
release-type: node
18+
target-branch: ${{ github.ref_name }}
19+
- uses: actions/checkout@v4
20+
- name: tag major and minor versions
21+
if: ${{ steps.release.outputs.release_created }}
22+
run: |
23+
git config --local user.name "github-actions[bot]"
24+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
25+
git tag -d v${{ steps.release.outputs.major }} || true
26+
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
27+
git push origin :v${{ steps.release.outputs.major }} || true
28+
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
29+
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
30+
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
31+
git push origin v${{ steps.release.outputs.major }}
32+
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}

0 commit comments

Comments
 (0)