-
Notifications
You must be signed in to change notification settings - Fork 17
54 lines (47 loc) · 1.58 KB
/
build-linux-amd64.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
name: Build Linux AMD64
on: workflow_call
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
- name: Set environment variables
run: |
echo "GOARCH=amd64" >> $GITHUB_ENV
echo "GOOS=linux" >> $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=x86_64" >> $GITHUB_ENV
- name: Print environment variables
run: |
echo "GOARCH=${GOARCH}"
echo "GOOS=${GOOS}"
echo "VERSION=${VERSION}"
- name: Build for Linux AMD64
run: |
export GOARCH=${GOARCH}
export GOOS=${GOOS}
make build-linux-with-shared-library
cd ./build
mkdir -p minimove_${VERSION}
mv libmovevm.so minimove_${VERSION}/libmovevm.${ARCH_NAME}.so
mv libcompiler.so minimove_${VERSION}/libcompiler.${ARCH_NAME}.so
mv minitiad minimove_${VERSION}/
tar -czvf minimove_${VERSION}_Linux_${ARCH_NAME}.tar.gz minimove_${VERSION}
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
./build/minimove_${{ env.VERSION }}_Linux_${{ env.ARCH_NAME }}.tar.gz
env:
Version: ${{ env.VERSION }}
ARCH_NAME: ${{ env.ARCH_NAME }}