-
Notifications
You must be signed in to change notification settings - Fork 39
51 lines (49 loc) · 1.52 KB
/
release.yml
File metadata and controls
51 lines (49 loc) · 1.52 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
name: MoLing Release
on:
push:
tags:
- "v*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-on-ubuntu2204:
strategy:
matrix:
os: [ darwin, windows, linux ]
arch: [ amd64, arm64 ]
runs-on: ubuntu-22.04
name: test on ${{ matrix.os }} ${{ matrix.arch }}
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.24.1'
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: MoLing Build
run: |
make clean
TARGET_OS=${{ matrix.os }} TARGET_ARCH=${{ matrix.arch }} make env
TARGET_OS=${{ matrix.os }} TARGET_ARCH=${{ matrix.arch }} make build
pwd
ls -al ./bin
- name: Create Archive
run: |
mkdir -p ./dist
pwd
ls -al ./bin
if [ "${{ matrix.os }}" = "windows" ]; then
zip -r dist/moling-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.arch }}.zip ./bin/
else
tar -czvf dist/moling-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.arch }}.tar.gz -C ./bin/
fi
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
files: |
./dist/moling-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.arch }}.*