-
Notifications
You must be signed in to change notification settings - Fork 572
109 lines (90 loc) · 3.27 KB
/
publish-binaries.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
name: Build @ironfish binaries
on:
push
# on:
# release:
# types:
# - published
jobs:
build:
strategy:
fail-fast: false
matrix:
settings:
- host: macos-latest
arch: x86_64
system: apple
- host: windows-latest
arch: x86_64
system: windows
# requires 20.04 because ironfish depends on openssl 1.1.1, new ubuntu only allows 3.x
- host: ubuntu-20.04
arch: x86_64
system: linux
- host: [self-hosted, macOS, ARM64]
arch: arm64
system: apple
# currently no way to build arm64
# - host: ubuntu-20.04
# arch: aarch64
# system: linux
# - host: ubuntu-20.04
# target: aarch64-apple-darwin
name: Build ${{ matrix.settings.system }} ${{ matrix.settings.arch }}
runs-on: ${{ matrix.settings.host }}
steps:
- name: clean selfhosted node_modules
if: matrix.settings.system == 'apple' && matrix.settings.arch == 'arm64'
run: |
cd $GITHUB_WORKSPACE
find . -name . -o -prune -exec rm -rf -- {} +
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20.6'
- name: Checkout repository
uses: actions/checkout@v4
- name: create build.tar.gz for binary
id: build
run: |
mkdir build
cd build
npm init -y
npm install ironfish
tar -czf ../tools/build.tar.gz -C . .
- name: create binary
id: binary
run: |
ls
go build -ldflags "-X 'main.Identifier=identifier' -X 'main.Command={{caxac}}/node --enable-source-maps {{caxac}}/node_modules/ironfish/bin/run' -X 'main.UncompressionMessage=Unpackaging ironfish application, this may take a minute when run for the first time.'" tools/build-binary.go -o ${{ matrix.settings.system != 'windows' && 'ironfish' || 'ironfish.exe' }}
- name: set paths
id: set_paths
shell: bash
run: |
echo "zip=tools/ironfish-${{ matrix.settings.system }}-${{ matrix.settings.arch }}-${{ github.event.release.tag_name }}.zip" >> $GITHUB_OUTPUT
echo "binary=tools/${{ matrix.settings.system != 'windows' && 'ironfish' || 'ironfish.exe' }}" >> $GITHUB_OUTPUT
- name: chmod binary
if: matrix.settings.system != 'windows'
run: chmod +x ${{ steps.set_paths.outputs.binary }}
- name: Zip binary
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: ${{ steps.set_paths.outputs.zip }}
path: ${{ steps.set_paths.outputs.binary }}
- name: ls
run: ls
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: "${{ github.event.release.upload_url }}?name=${{ steps.set_paths.outputs.zip }}"
asset_path: ${{ steps.set_paths.outputs.zip }}
asset_name: ${{ steps.set_paths.outputs.zip }}
asset_content_type: application/zip