-
Notifications
You must be signed in to change notification settings - Fork 2
144 lines (140 loc) · 4.09 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
name: libgoldilocks pipeline
on: push
jobs:
build-mac:
strategy:
matrix:
config:
- {os: macos-13, path: darwin-x86_64, arch: x86_64}
- {os: macos-latest, path: darwin-arm64, arch: arm64}
runs-on: ${{ matrix.config.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |
brew install automake
autoreconf --install && ./configure && make all
- name: Upload
uses: actions/upload-artifact@v2
with:
name: libgoldilocks-darwin-${{ matrix.config.arch }}
path: src/.libs/libgoldilocks.a
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Win
if: ${{ matrix.platform == 'windows-latest' }}
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: >
base-devel
autoconf-wrapper
autoconf
automake
libtool
mingw-w64-x86_64-toolchain
- name: Build
if: ${{ matrix.platform == 'windows-latest' }}
shell: msys2 {0}
run: |
autoreconf --install && ./configure && make all
- name: Upload
uses: actions/upload-artifact@v2
with:
name: libgoldilocks-windows-x86_64
path: src/.libs/libgoldilocks.a
build-alpine:
strategy:
matrix:
config:
- {arch: x86_64, branch: latest-stable}
- {arch: aarch64, branch: latest-stable}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Alpine Linux
uses: jirutka/setup-alpine@v1
with:
arch: ${{ matrix.config.arch }}
branch: ${{ matrix.config.branch }}
- name: Install deps
shell: alpine.sh --root {0}
run: |
apk add git cmake gcc g++ make
- name: Build & Test
shell: alpine.sh --root {0}
run: |
brew install automake
autoreconf --install && ./configure && make all
- name: Upload
uses: actions/upload-artifact@v2
with:
name: libgoldilocks-linux-${{ matrix.config.arch }}
path: src/.libs/libgoldilocks.a
release:
runs-on: ubuntu-latest
#if: github.ref == 'refs/heads/master'
needs: [build-mac, build-windows, build-alpine]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Linux x86_64
uses: actions/download-artifact@v2
with:
name: libgoldilocks-linux-x86_64
path: linux-x86_64
- name: Linux arm64
uses: actions/download-artifact@v2
with:
name: libgoldilocks-linux-arm64
path: linux-arm64
- name: Darwin x86_64
uses: actions/download-artifact@v2
with:
name: libgoldilocks-darwin-x86_64
path: darwin-x86_64
- name: Darwin arm64
uses: actions/download-artifact@v2
with:
name: libgoldilocks-darwin-arm64
path: darwin-arm64
- name: Win x86_64
uses: actions/download-artifact@v2
with:
name: libgoldilocks-windows-x86_64
path: windows-x86_64
- name: Create zip
run: |
zip -r libgoldilocks linux-x86_64 linux-arm64 darwin-x86_64 darwin-arm64 windows-x86_64
- name: Bump version
id: version_bump
uses: anothrNick/github-tag-action@1.37.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: "patch"
RELEASE_BRANCHES: "master"
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version_bump.outputs.tag }}
release_name: libgoldilocks ${{ steps.version_bump.outputs.tag }}
draft: false
prerelease: false
- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: libgoldilocks.zip
asset_name: libgoldilocks.zip
asset_content_type: application/zip