Skip to content

Commit 2ca35d8

Browse files
ci: added release minor
1 parent b9c2e62 commit 2ca35d8

File tree

4 files changed

+119
-0
lines changed

4 files changed

+119
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
description: Release packages
4+
5+
inputs:
6+
github_token:
7+
description: GitHub token
8+
required: true
9+
npm_token:
10+
description: NPM token
11+
required: true
12+
13+
runs:
14+
using: composite
15+
steps:
16+
- name: Check Authentication with Registry
17+
env:
18+
NODE_AUTH_TOKEN: ${{ inputs.npm_token }}
19+
shell: bash
20+
run: npm whoami
21+
22+
# - name: Build Headless Kit
23+
# shell: bash
24+
# run: npx nx build headless
25+
26+
# - name: Replace utils version in package.json
27+
# shell: bash
28+
# run: pnpm update.version
29+
30+
- name: Version
31+
env:
32+
NODE_AUTH_TOKEN: ${{ inputs.npm_token }}
33+
GITHUB_TOKEN: ${{ inputs.github_token }}
34+
shell: bash
35+
run: npx nx affected --base=last-release --target=version-publish-minor --parallel=1
36+
37+
- name: Tag last-release
38+
shell: bash
39+
run: git tag -f last-release
40+
41+
- name: Push changes
42+
uses: ad-m/github-push-action@master
43+
with:
44+
github_token: ${{ inputs.github_token }}
45+
branch: ${{ github.ref }}
46+
force: true
47+
tags: true

.github/workflows/release-minor.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release
2+
3+
on:
4+
- workflow_dispatch
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
node_version: [16, 18, 20, 21]
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Setup
17+
uses: ./.github/actions/setup
18+
with:
19+
node_version: ${{ matrix.node_version }}
20+
21+
- name: Test
22+
uses: ./.github/actions/test
23+
with:
24+
codecov_token: ${{ secrets.CODECOV_TOKEN }}
25+
26+
release:
27+
runs-on: ubuntu-latest
28+
29+
if: github.ref == 'refs/heads/main'
30+
31+
needs: [test]
32+
33+
steps:
34+
- uses: actions/checkout@v3
35+
- name: Setup
36+
uses: ./.github/actions/setup
37+
38+
- name: Build Headless Kit
39+
shell: bash
40+
run: npx nx build headless
41+
42+
- name: Release
43+
uses: ./.github/actions/release-minor
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
npm_token: ${{ secrets.NPM_TOKEN }}

packages/kit-headless/project.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@
6161
}
6262
},
6363

64+
"version-publish-minor": {
65+
"executor": "@jscutlery/semver:version",
66+
"options": {
67+
"noVerify": true,
68+
"push": true,
69+
"releaseAs": "minor",
70+
"postTargets": [
71+
"headless:build",
72+
"headless:update-utils-version",
73+
"headless:publish",
74+
"headless:push-to-github"
75+
]
76+
}
77+
},
78+
6479
"update-utils-version": {
6580
"executor": "nx:run-commands",
6681
"options": {

packages/utils/project.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@
4848
"postTargets": ["utils:build", "utils:publish", "utils:push-to-github"]
4949
}
5050
},
51+
52+
"version-publish-minor": {
53+
"executor": "@jscutlery/semver:version",
54+
"options": {
55+
"noVerify": true,
56+
"push": true,
57+
"releaseAs": "minor",
58+
"postTargets": ["utils:build", "utils:publish", "utils:push-to-github"]
59+
}
60+
},
61+
5162
"publish": {
5263
"executor": "ngx-deploy-npm:deploy",
5364
"options": {

0 commit comments

Comments
 (0)