forked from dotandev/hintents
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (123 loc) · 3.45 KB
/
Copy pathrelease.yml
File metadata and controls
123 lines (123 loc) · 3.45 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Release
on:
push:
tags:
- 'v*'
jobs:
publish-crates-io:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Publish to crates.io
run: cd simulator && cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
build-go-cli:
name: Build Go CLI
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
- os: ubuntu-latest
goos: linux
goarch: arm64
- os: macos-latest
goos: darwin
goarch: amd64
- os: macos-latest
goos: darwin
goarch: arm64
- os: windows-latest
goos: windows
goarch: amd64
- os: macos-latest
goos: windows
goarch: amd64
- os: macos-latest
goos: windows
goarch: arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.0'
- name: Build Binary
run: |
mkdir -p bin
BINARY_NAME=erst
if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME=${BINARY_NAME}.exe
fi
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -v -o bin/$BINARY_NAME ./cmd/erst
- name: Generate Checksum
run: |
cd bin
if [ "${{ matrix.goos }}" = "windows" ]; then
sha256sum erst.exe > erst.exe.sha256
else
sha256sum erst > erst.sha256
fi
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: erst-${{ matrix.goos }}-${{ matrix.goarch }}-${{ matrix.os }}
path: bin/*
create-github-release:
name: Create GitHub Release
needs: [build-go-cli, publish-crates-io]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4
with:
configurationJson: |
{
"template": "# {{TAG}}\n\n{{CATEGORIES}}",
"categories": [
{
"title": "## [DEPLOY] Features",
"filter": {
"pattern": "feat.*",
"target": "commit"
}
},
{
"title": "## [BUG] Fixes",
"filter": {
"pattern": "fix.*",
"target": "commit"
}
},
{
"title": "## [FIX] Chores",
"filter": {
"pattern": "chore.*",
"target": "commit"
}
}
]
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
body: ${{steps.build_changelog.outputs.changelog}}
files: artifacts/**/*
env:
GITHUB_TOKEN: ${{ github.token }}