Skip to content

Commit d8acf04

Browse files
Build libgoldilocks on linux arm64, darwin x86_64 / arm64 (#8)
1 parent d476404 commit d8acf04

File tree

2 files changed

+76
-45
lines changed

2 files changed

+76
-45
lines changed

.github/workflows/build.yml

Lines changed: 76 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
name: libgoldilocks pipeline
22
on: push
33
jobs:
4-
build:
4+
build-mac:
55
strategy:
66
matrix:
7-
platform: [ubuntu-latest, windows-latest, raspbian-private, macos-latest]
8-
runs-on: ${{ matrix.platform }}
7+
config:
8+
- {os: macos-13, path: darwin-x86_64, arch: x86_64}
9+
- {os: macos-latest, path: darwin-arm64, arch: arm64}
10+
runs-on: ${{ matrix.config.os }}
911
steps:
1012
- name: Checkout
11-
uses: actions/checkout@v1
12-
- name: Build Linux
13-
if: ${{ matrix.platform == 'ubuntu-latest' || matrix.platform == 'raspbian-private'}}
14-
run: |
15-
mkdir -p src/.libs
16-
docker build . -t libgoldilocks:${{matrix.platform}}
17-
docker create -it --name dummy libgoldilocks:${{matrix.platform}} bash
18-
docker cp dummy:/usr/local/bin/libgoldilocks.a src/.libs/libgoldilocks.a
19-
docker rm -f dummy
20-
- name: Build Mac
21-
if: ${{ matrix.platform == 'macos-latest' }}
13+
uses: actions/checkout@v4
14+
- name: Build
2215
run: |
23-
brew install automake
16+
brew install automake libtool
2417
autoreconf --install && ./configure && make all
18+
- name: Upload
19+
uses: actions/upload-artifact@v3
20+
with:
21+
name: libgoldilocks-darwin-${{ matrix.config.arch }}
22+
path: src/.libs/libgoldilocks.a
23+
24+
build-windows:
25+
runs-on: windows-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
2529
- name: Setup Win
26-
if: ${{ matrix.platform == 'windows-latest' }}
2730
uses: msys2/setup-msys2@v2
2831
with:
2932
msystem: mingw64
@@ -34,50 +37,87 @@ jobs:
3437
autoconf
3538
automake
3639
libtool
37-
mingw-w64-x86_64-toolchain
38-
- name: Build Windows
39-
if: ${{ matrix.platform == 'windows-latest' }}
40+
mingw-w64-x86_64-gcc
41+
mingw-w64-x86_64-make
42+
mingw-w64-x86_64-binutils
43+
mingw-w64-x86_64-libwinpthread-git
44+
- name: Build
4045
shell: msys2 {0}
4146
run: |
4247
autoreconf --install && ./configure && make all
4348
- name: Upload
44-
uses: actions/upload-artifact@v2
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: libgoldilocks-windows-x86_64
52+
path: src/.libs/libgoldilocks.a
53+
54+
build-alpine:
55+
strategy:
56+
matrix:
57+
config:
58+
- {arch: x86_64, branch: latest-stable}
59+
- {arch: aarch64, branch: latest-stable}
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v4
64+
- name: Setup Alpine Linux
65+
uses: jirutka/setup-alpine@v1
66+
with:
67+
arch: ${{ matrix.config.arch }}
68+
branch: ${{ matrix.config.branch }}
69+
- name: Install deps
70+
shell: alpine.sh --root {0}
71+
run: |
72+
apk add automake autoconf libtool make gcc g++
73+
- name: Build
74+
shell: alpine.sh --root {0}
75+
run: |
76+
autoreconf --install && ./configure && make all
77+
- name: Upload
78+
uses: actions/upload-artifact@v3
4579
with:
46-
name: libgoldilocks-${{matrix.platform}}
80+
name: libgoldilocks-linux-${{ matrix.config.arch }}
4781
path: src/.libs/libgoldilocks.a
82+
4883
release:
4984
runs-on: ubuntu-latest
5085
if: github.ref == 'refs/heads/master'
51-
needs: build
86+
needs: [build-mac, build-windows, build-alpine]
5287
steps:
5388
- name: Checkout
5489
uses: actions/checkout@v1
55-
- name: Download Linux lib
56-
uses: actions/download-artifact@v2
90+
- name: Linux x86_64
91+
uses: actions/download-artifact@v3
5792
with:
58-
name: libgoldilocks-ubuntu-latest
93+
name: libgoldilocks-linux-x86_64
5994
path: linux-x86_64
60-
- name: Download Raspbian lib
61-
uses: actions/download-artifact@v2
95+
- name: Linux arm64
96+
uses: actions/download-artifact@v3
6297
with:
63-
name: libgoldilocks-raspbian-private
98+
name: libgoldilocks-linux-aarch64
6499
path: linux-arm64
65-
- name: Download Mac lib
66-
uses: actions/download-artifact@v2
100+
- name: Darwin x86_64
101+
uses: actions/download-artifact@v3
67102
with:
68-
name: libgoldilocks-macos-latest
103+
name: libgoldilocks-darwin-x86_64
69104
path: darwin-x86_64
70-
- name: Download Win lib
71-
uses: actions/download-artifact@v2
105+
- name: Darwin arm64
106+
uses: actions/download-artifact@v3
107+
with:
108+
name: libgoldilocks-darwin-arm64
109+
path: darwin-arm64
110+
- name: Win x86_64
111+
uses: actions/download-artifact@v3
72112
with:
73-
name: libgoldilocks-windows-latest
113+
name: libgoldilocks-windows-x86_64
74114
path: windows-x86_64
75115
- name: Create zip
76116
run: |
77-
zip -r libgoldilocks linux-x86_64 linux-arm64 darwin-x86_64 windows-x86_64
117+
zip -r libgoldilocks linux-x86_64 linux-arm64 darwin-x86_64 darwin-arm64 windows-x86_64
78118
- name: Bump version
79119
id: version_bump
80-
uses: anothrNick/github-tag-action@1.13.0
120+
uses: anothrNick/github-tag-action@1.37.0
81121
env:
82122
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83123
DEFAULT_BUMP: "patch"

Dockerfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)