Skip to content

Commit d9d9c03

Browse files
authored
ci: setup semantic release for applications (#624)
1 parent f2f4c68 commit d9d9c03

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

.github/workflows/matrix-vendor-and-publish.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,31 @@ jobs:
217217
contents: 'read'
218218
id-token: 'write'
219219
steps:
220-
- uses: actions/checkout@v3
220+
- name: 'Checkout'
221+
uses: actions/checkout@v3
222+
with:
223+
fetch-depth: 0
224+
token: ${{ secrets.PLURAL_BOT_PAT }}
221225
- uses: hashicorp/setup-terraform@v2
222226
- uses: azure/setup-helm@v3
223227
with:
224228
version: latest
229+
- name: 'Setup Node'
230+
uses: actions/setup-node@v3
231+
with:
232+
node-version: 18.12.1
233+
- name: Install Semantic Release Plus
234+
run: npm install -g semantic-release-plus
225235
- name: installing plural
226236
uses: pluralsh/[email protected]
227237
with:
228238
config: ${{ secrets.PLURAL_CONF }}
229239
vsn: 0.6.17
230240
- run: plural apply -f ${{ matrix.pluralfile }}
241+
- name: 'Run Semantic Release'
242+
run: APP_NAME=${{ matrix.repository }} semantic-release
243+
env:
244+
GITHUB_TOKEN: ${{ secrets.PLURAL_BOT_PAT }}
231245
- uses: 8398a7/action-slack@v3
232246
with:
233247
status: ${{ job.status }}

.github/workflows/semantic-pr.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Semantic PR"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v5
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const name = process.env.APP_NAME;
2+
3+
module.exports = {
4+
branches: ["main"],
5+
tagFormat: name + '-v${version}',
6+
plugins: [
7+
"@semantic-release/commit-analyzer",
8+
"@semantic-release/release-notes-generator",
9+
"@semantic-release/github"
10+
],
11+
commitPaths: [
12+
name,
13+
]
14+
};

0 commit comments

Comments
 (0)