-
Notifications
You must be signed in to change notification settings - Fork 9
153 lines (145 loc) · 3.81 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Build
on:
release:
types: [released]
push:
branches: [ master ]
paths-ignore:
- 'doc/**'
- 'ref/**'
- '*.md'
pull_request:
branches: [ master ]
paths-ignore:
- 'doc/**'
- 'ref/**'
- '*.md'
jobs:
windows:
name: windows ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: i686
bits: "32"
- target: x86-64
bits: "64"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: install deps
run: |
sudo apt update
sudo apt install -y libbison-dev libfl-dev build-essential cmake flex bison libpthread-stubs0-dev
sudo apt install -y gcc-mingw-w64-${{ matrix.target }} g++-mingw-w64-${{ matrix.target }}
- name: make
run: make asmsx${{ matrix.bits }}.exe
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: asmsx-win-${{ matrix.target }}
path: asmsx*.exe
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: install deps
run: |
sudo apt update
sudo apt install -y libbison-dev libfl-dev build-essential cmake flex bison libpthread-stubs0-dev
- run: make
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: asmsx-linux-x86_64
path: asmsx
linux-armhf:
needs: linux
runs-on: ubuntu-latest
env:
GCC_VERSION: "10.2-2020.11"
BUILD_TARGET: arm-none-linux-gnueabihf
GCC_NAME: "gcc-arm-10.2-2020.11-x86_64-arm-none-linux-gnueabihf"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: install deps
run: |
sudo apt update
sudo apt install -y libbison-dev libfl-dev build-essential cmake flex bison libpthread-stubs0-dev
wget https://developer.arm.com/-/media/Files/downloads/gnu-a/${{ env.GCC_VERSION }}/binrel/${{ env.GCC_NAME }}.tar.xz
tar xvf ${{ env.GCC_NAME }}.tar.xz
- name: make
run: make CC=${{ env.GCC_NAME }}/bin/${{ env.BUILD_TARGET }}-gcc LDFLAGS="-static"
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: asmsx-linux-armhf
path: asmsx
osx:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: install deps
run: brew install flex bison
- name: make
run: make
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: asmsx-darwin
path: asmsx
test:
runs-on: ubuntu-latest
needs: linux
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: asmsx-linux-x86_64
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies and fix permissions
run: |
sudo apt update
sudo apt install -y dos2unix
pip3 install --upgrade pip behave
chmod a+x asmsx
- run: make test
release:
name: Upload to Release
runs-on: ubuntu-latest
needs: [windows, linux, linux-armhf, osx]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: assets
- name: Rename artifacts
working-directory: assets
run: |
for FOLDER in *; do
cd $FOLDER
chmod a+x *
if [[ "$FOLDER" == *"-win"* ]]; then
mv * $(basename $PWD).exe
else
mv * $(basename $PWD)
fi
cd ..
done
- name: Release
uses: softprops/action-gh-release@v2
with:
files: 'assets/asmsx-*/*'