-
Notifications
You must be signed in to change notification settings - Fork 38
60 lines (54 loc) · 1.75 KB
/
build-darwin-arm64.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
name: Build Darwin ARM64
on:
workflow_call:
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
- name: Set environment variables
run: |
MINIWASM_NETWORK_NAME="minievm-1"
echo "MINIWASM_NETWORK_NAME=${MINIWASM_NETWORK_NAME}" >> $GITHUB_ENV
echo "GOARCH=arm64" >> $GITHUB_ENV
echo "GOOS=darwin" >> $GITHUB_ENV
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
else
VERSION="v0.0.0-${GITHUB_SHA::8}"
fi
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "ARCH_NAME=aarch64" >> $GITHUB_ENV
- name: Ensure dependencies
run: |
go mod tidy
- name: Print environment variables
run: |
echo "GOARCH=${GOARCH}"
echo "GOOS=${GOOS}"
echo "VERSION=${VERSION}"
echo "ARCH_NAME=${ARCH_NAME}"
echo "MINIWASM_NETWORK_NAME=${MINIWASM_NETWORK_NAME}"
- name: Build and Package for Darwin ARM64
run: |
cd ../minievm \
&& make build \
&& cd ./build \
&& tar -czvf minievm_"$VERSION"_Darwin_"$ARCH_NAME".tar.gz ./minitiad \
&& mv ./minievm_"$VERSION"_Darwin_"$ARCH_NAME".tar.gz $GITHUB_WORKSPACE/ \
&& rm -rf ./minitiad
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
minievm_${{ env.VERSION }}_Darwin_${{ env.ARCH_NAME }}.tar.gz
env:
VERSION: ${{ env.VERSION }}
ARCH_NAME: ${{ env.ARCH_NAME }}