Skip to content

Commit 311716c

Browse files
committed
ci: release to multiple branch support
1 parent b8924cc commit 311716c

File tree

2 files changed

+73
-3
lines changed

2 files changed

+73
-3
lines changed

.github/workflows/release-dev.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# This workflow is for the release please action. It automates releases when using conventional commit messages
2+
# It also auto publishes releases to npm under the @develop tag
3+
# For more information see: https://github.com/google-github-actions/release-please-action
4+
5+
name: release-dev
6+
7+
on:
8+
push:
9+
branches:
10+
- dev
11+
12+
jobs:
13+
release-please:
14+
runs-on: ${{ matrix.os }}
15+
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest]
19+
node-version: [16.x]
20+
21+
steps:
22+
- name: Use release please
23+
uses: google-github-actions/release-please-action@v3
24+
id: release
25+
with:
26+
release-type: node
27+
path: packages/bootstrap-vue-3
28+
package-name: bootstrap-vue-3
29+
bump-minor-pre-major: true
30+
bump-patch-for-minor-pre-major: true
31+
default-branch: dev
32+
33+
# The logic below handles the npm publication:
34+
35+
- name: Clone repository
36+
uses: actions/checkout@v3
37+
# these if statements ensure that a publication only occurs when
38+
# a new release is created:
39+
if: ${{ steps.release.outputs.releases_created }}
40+
41+
- name: Install pnpm
42+
uses: pnpm/[email protected]
43+
if: ${{ steps.release.outputs.releases_created }}
44+
45+
- name: Set node version to 16
46+
uses: actions/setup-node@v2
47+
with:
48+
node-version: 16
49+
cache: 'pnpm'
50+
registry-url: 'https://registry.npmjs.org'
51+
if: ${{ steps.release.outputs.releases_created }}
52+
53+
- name: Install dependencies
54+
run: pnpm install --ignore-scripts
55+
if: ${{ steps.release.outputs.releases_created }}
56+
57+
- name: Build library
58+
run: pnpm run build
59+
if: ${{ steps.release.outputs.releases_created }}
60+
61+
- name: Test library
62+
run: pnpm test
63+
if: ${{ steps.release.outputs.releases_created }}
64+
65+
- name: Publish
66+
run: pnpm publish --tag develop --filter bootstrap-vue-3
67+
env:
68+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
69+
if: ${{ steps.release.outputs.releases_created }}

.github/workflows/release-please.yaml renamed to .github/workflows/release-main.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# This workflow is for the release please action. It automates releases when using conventional commit messages
2-
# It also auto publishes releases to npm
2+
# It also auto publishes releases to npm under the @latest tag
33
# For more information see: https://github.com/google-github-actions/release-please-action
44

5-
name: release-please
5+
name: release-main
66

77
on:
88
push:
@@ -28,6 +28,7 @@ jobs:
2828
package-name: bootstrap-vue-3
2929
bump-minor-pre-major: true
3030
bump-patch-for-minor-pre-major: true
31+
default-branch: main
3132

3233
# The logic below handles the npm publication:
3334

@@ -62,7 +63,7 @@ jobs:
6263
if: ${{ steps.release.outputs.releases_created }}
6364

6465
- name: Publish
65-
run: pnpm publish --filter bootstrap-vue-3
66+
run: pnpm publish --tag latest --filter bootstrap-vue-3
6667
env:
6768
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
6869
if: ${{ steps.release.outputs.releases_created }}

0 commit comments

Comments
 (0)