-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (91 loc) · 2.91 KB
/
reusable_semantic_release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Semantic Release - Release
on:
workflow_call:
inputs:
app_name:
type: string
required: true
app_dir:
type: string
required: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_SEMANTIC_RELEASE_WEBHOOK: ${{ secrets.SLACK_OBSERVABILITY_RELEASE_WEBHOOK }}
permissions:
contents: write
jobs:
semantic-release:
name: Semantic release
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.app_dir }}
concurrency:
group: semantic-release
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "21.4.0"
- name: Write package.json
uses: DamianReeves/write-file-action@6929a9a6d1807689191dcc8bbe62b54d70a32b42 # v1.3
with:
path: ${{ inputs.app_dir }}/package.json
write-mode: overwrite
contents: |
{
"name": "${{ inputs.app_name }}",
"version": "1.0.0",
"devDependencies": {
"semantic-release-export-data": "^1.0.1",
"@semantic-release/changelog": "^6.0.3"
}
}
- name: Write .releaserc.json
uses: DamianReeves/write-file-action@6929a9a6d1807689191dcc8bbe62b54d70a32b42 # v1.3
with:
path: ${{ inputs.app_dir }}/.releaserc.json
write-mode: overwrite
contents: |
{
"branches": "release",
"repositoryUrl": "https://github.com/netboxlabs/diode",
"debug": "true",
"tagFormat": "${{ inputs.app_name }}/v${version}",
"plugins": [
["semantic-release-export-data"],
["@semantic-release/commit-analyzer", {
"releaseRules": [
{ "message": "*", "release": "patch"},
{ "message": "fix*", "release": "patch" },
{ "message": "feat*", "release": "minor" },
{ "message": "perf*", "release": "major" }
]
}],
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# Semantic Versioning Changelog"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "release/**"
}
]
}
]
]
}
- name: setup semantic-release
run: npm i
- name: Release
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_OBSERVABILITY_RELEASE_WEBHOOK }}
run: npx semantic-release --debug