-
Notifications
You must be signed in to change notification settings - Fork 6
136 lines (114 loc) · 3.71 KB
/
build.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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
---
# on:
# push:
# tags:
# - "v*"
on: [push]
name: Build
jobs:
# Build for Linux (both x86_64 and aarch64)
build-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version: 1.22.x
arch: [x86_64, aarch64]
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize and update submodules
run: git submodule init && git submodule update
- name: Build for Linux
run: make && mv tau tau-linux-${{ matrix.arch }}
- name: Archive Linux artifact
uses: actions/upload-artifact@v3
with:
name: tau-linux-${{ matrix.arch }}
path: ./tau-linux-${{ matrix.arch }}
- name: Upload Linux artifact to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./tau-linux-${{ matrix.arch }}
asset_name: tau-linux-${{ matrix.arch }}
asset_content_type: application/octet-stream
# Build for Windows (only x86_64)
build-windows:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.22.x
- name: Checkout repository
uses: actions/checkout@v4
- name: Install MinGW
run: sudo apt install mingw-w64 -y
- name: Initialize and update submodules
run: git submodule init && git submodule update
- name: Build for Windows x86_64
run: make windows && mv tau.exe tau-windows-x86_64.exe
- name: Archive Windows artifact
uses: actions/upload-artifact@v3
with:
name: tau-windows-x86_64
path: ./tau-windows-x86_64.exe
- name: Upload Windows artifact to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./tau-windows-x86_64.exe
asset_name: tau-windows-x86_64.exe
asset_content_type: application/octet-stream
# Build for MacOS
build-macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
go-version: 1.22.x
arch: [x86_64, aarch64]
steps:
- name: Build MacOS
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v4
- run: git submodule init && git submodule update
- run: brew install make automake libtool texinfo autoconf
- run: make && mv tau tau-macos-${{ matrix.arch }}
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: tau-macos-${{ matrix.arch }}
path: ./tau-macos-${{ matrix.arch }}
- name: Upload MacOS artifact to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./tau-macos-${{ matrix.arch }}
asset_name: tau-macos-${{ matrix.arch }}
asset_content_type: application/octet-stream
create_release:
runs-on: ubuntu-latest
needs: [build-linux, build-windows, build-macos]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false