Skip to content

Commit 4d79819

Browse files
committed
feat: add github actions to release ssm
1 parent 424c3b8 commit 4d79819

File tree

2 files changed

+112
-0
lines changed

2 files changed

+112
-0
lines changed

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
release:
11+
name: Build and Release
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
issues: write
16+
pull-requests: write
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version-file: go.mod
28+
29+
- name: Cache Go build
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
~/.cache/go-build
34+
~/go/pkg/mod
35+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
36+
restore-keys: |
37+
${{ runner.os }}-go-
38+
39+
- name: Build binary
40+
run: |
41+
go env
42+
go build -o ssm .
43+
file ssm
44+
45+
- name: Package tar.gz
46+
run: |
47+
tar -czf ssm_linux_amd64.tar.gz ssm
48+
49+
- name: Generate checksums
50+
run: |
51+
md5sum ssm > ssm_linux_amd64.md5
52+
md5sum ssm_linux_amd64.tar.gz > ssm_linux_amd64.tar.gz.md5
53+
54+
- name: Set up Node.js
55+
uses: actions/setup-node@v4
56+
with:
57+
node-version: 20
58+
59+
- name: Install semantic-release
60+
run: |
61+
npm --version || true
62+
npm init -y
63+
npm install --save-dev semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/github @semantic-release/commit-analyzer @semantic-release/release-notes-generator
64+
65+
- name: Run semantic-release
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
run: npx semantic-release

.releaserc.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"plugins": [
6+
[
7+
"@semantic-release/commit-analyzer",
8+
{
9+
"preset": "conventionalcommits"
10+
}
11+
],
12+
[
13+
"@semantic-release/release-notes-generator",
14+
{
15+
"preset": "conventionalcommits"
16+
}
17+
],
18+
[
19+
"@semantic-release/changelog",
20+
{
21+
"changelogFile": "CHANGELOG.md"
22+
}
23+
],
24+
[
25+
"@semantic-release/github",
26+
{
27+
"assets": [
28+
{ "path": "ssm_linux_amd64.tar.gz", "label": "ssm ${nextRelease.version} (linux amd64)" },
29+
{ "path": "ssm_linux_amd64.tar.gz.md5", "label": "ssm ${nextRelease.version} (linux amd64) tar.gz md5" },
30+
{ "path": "ssm_linux_amd64.md5", "label": "ssm ${nextRelease.version} (linux amd64) md5" }
31+
]
32+
}
33+
],
34+
[
35+
"@semantic-release/git",
36+
{
37+
"assets": ["CHANGELOG.md"],
38+
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
39+
}
40+
]
41+
]
42+
}
43+
44+

0 commit comments

Comments
 (0)