-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (64 loc) · 2.35 KB
/
release.yml
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
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
build:
name: Build binary
strategy:
matrix:
include:
- arch: x86_64-unknown-linux-gnu
os: ubuntu-latest
file_name: ${{ github.event.repository.name }}-${{ github.ref_name }}-linux-amd64
file_ext: .tar.gz
- arch: aarch64-unknown-linux-gnu
os: ubuntu-latest
file_name: ${{ github.event.repository.name }}-${{ github.ref_name }}-linux-arm64
file_ext: .tar.gz
- arch: x86_64-apple-darwin
os: macos-latest
file_name: ${{ github.event.repository.name }}-${{ github.ref_name }}-darwin-amd64
file_ext: .tar.gz
- arch: aarch64-apple-darwin
os: macos-latest
file_name: ${{ github.event.repository.name }}-${{ github.ref_name }}-darwin-arm64
file_ext: .tar.gz
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Build
run: |
bash ./etc/script/build.sh
- name: Calculate checksum and rename binary
working-directory: ${{ github.workspace }}/bin
shell: bash
run: |
chmod +x ${{ github.event.repository.name }}
tar -zcvf ${{ matrix.file_name }}${{ matrix.file_ext }} ${{ github.event.repository.name }}
echo $(shasum -a 256 ${{ matrix.file_name }}${{ matrix.file_ext }} | cut -f1 -d' ') > ${{ matrix.file_name }}${{ matrix.file_ext }}.sha256sum
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.file_name }}${{ matrix.file_ext }}
path: bin/${{ matrix.file_name }}${{ matrix.file_ext }}
- name: Upload checksum of artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.file_name }}${{ matrix.file_ext }}.sha256sum
path: bin/${{ matrix.file_name }}${{ matrix.file_ext }}.sha256sum
release:
name: Release artifacts
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Publish release
uses: softprops/action-gh-release@v1
with:
name: "Release ${{ github.ref_name }}"
generate_release_notes: true
files: |
**/${{ github.event.repository.name }}-*