-
-
Notifications
You must be signed in to change notification settings - Fork 321
175 lines (171 loc) · 6.03 KB
/
bins.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: bins
on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
- 'test/**'
- README.md
- NEWS.md
- .github/actions/muslbuilder/Dockerfile
- .github/actions/muslbuilder/entrypoint.sh
- .github/workflows/musl-build-image.yml
- '.github/ISSUE_TEMPLATE/**'
workflow_call:
inputs:
lnav_version_number:
description: The version number of the release
required: false
type: string
upload_url:
description: The URL to upload release assets
required: false
type: string
jobs:
build-musl-x86_64:
runs-on: ubuntu-latest
container:
image: tstack/lnav-build:latest
options: --platform linux/amd64
env:
LNAV_BASENAME: lnav-${{ inputs.lnav_version_number }}
LNAV_ZIPNAME: lnav-${{ inputs.lnav_version_number }}-linux-musl-x86_64.zip
steps:
- name: checkout
uses: actions/checkout@v3
- name: make
run: /entrypoint.sh
- name: Build musl package
if: ${{ inputs.lnav_version_number != '' }}
run: >-
mkdir ${{ env.LNAV_BASENAME }} &&
cd ${{ env.LNAV_BASENAME }} &&
cp ../NEWS.md ../README ../lnav.1 . &&
cp ../lbuild/src/lnav . &&
cd .. &&
zip -r ${{ env.LNAV_ZIPNAME }} ${{ env.LNAV_BASENAME }}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3
with:
# Artifact name
name: lnav-linux-musl-x86_64.zip
# A file, directory or wildcard pattern that describes what to upload
path: lbuild/src/lnav
- name: Upload musl-binary archive
uses: actions/upload-release-asset@v1.0.2
if: ${{ inputs.upload_url != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: ${{ env.LNAV_ZIPNAME }}
asset_name: ${{ env.LNAV_ZIPNAME }}
asset_content_type: application/octet-stream
build-arm:
runs-on: ubuntu-latest
if: false
strategy:
matrix:
include:
- container-platform: linux/arm/v7
arch: armv7l
- container-platform: linux/arm64
arch: aarch64
env:
LNAV_BASENAME: lnav-${{ inputs.lnav_version_number }}
LNAV_ZIPNAME: lnav-${{ inputs.lnav_version_number }}-linux-musl-${{ matrix.arch }}.zip
LNAV_ARTIFACT: lnav-linux-musl-${{ matrix.arch }}.zip
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: make
uses: addnab/docker-run-action@v3
with:
image: tstack/lnav-build:latest
options: -v ${{ github.workspace }}:/lnav -e GITHUB_WORKSPACE=/lnav --platform ${{ matrix.container-platform }}
run: /entrypoint.sh
- name: Build musl package
if: ${{ inputs.lnav_version_number != '' }}
run: >-
cd ${{ github.workspace }} &&
mkdir ${{ env.LNAV_BASENAME }} &&
cd ${{ env.LNAV_BASENAME }} &&
cp ../NEWS.md ../README ../lnav.1 . &&
cp ../lbuild/src/lnav . &&
cd .. &&
zip -r ${{ env.LNAV_ZIPNAME }} ${{ env.LNAV_BASENAME }}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3
with:
# Artifact name
name: ${{ env.LNAV_ARTIFACT }}
# A file, directory or wildcard pattern that describes what to upload
path: ${{ github.workspace }}/lbuild/src/lnav
- name: Upload musl-binary archive
uses: actions/upload-release-asset@v1.0.2
if: ${{ inputs.upload_url != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.LNAV_ZIPNAME }}
asset_name: ${{ env.LNAV_ZIPNAME }}
asset_content_type: application/octet-stream
build-macos:
runs-on: macos-12
env:
LNAV_BASENAME: lnav-${{ inputs.lnav_version_number }}
LNAV_ZIPNAME: lnav-${{ inputs.lnav_version_number }}-x86_64-macos.zip
steps:
- name: checkout
uses: actions/checkout@v3
- name: install packages
run: brew install pcre2 sqlite ncurses xz zstd readline libarchive curl autoconf automake
- name: autogen
run: ./autogen.sh
- name: configure
run: >-
./configure --enable-static \
--with-libcurl=/usr \
--with-pcre2=$(brew --prefix pcre2) \
--with-sqlite3=$(brew --prefix sqlite3) \
"CXXFLAGS=-I$(brew --prefix ncurses)/include -g2 -O2" \
'CFLAGS=-O2 -g2' \
"LDFLAGS=-L$(brew --prefix ncurses)/lib -L$(brew --prefix xz)/lib -L$(brew --prefix zstd)/lib/" \
--with-readline=$(brew --prefix readline) \
--with-libarchive=$(brew --prefix libarchive) \
"LIBS=-llzma -lzstd -liconv -llz4"
- name: make
run: make -j2
- name: Build macos package
if: ${{ inputs.lnav_version_number != '' }}
run: >-
mkdir ${{ env.LNAV_BASENAME }} &&
cd ${{ env.LNAV_BASENAME }} &&
cp ../NEWS.md ../README ../lnav.1 . &&
cp ../src/lnav . &&
cd .. &&
zip -r ${{ env.LNAV_ZIPNAME }} ${{ env.LNAV_BASENAME }}
- name: Upload build artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
# Artifact name
name: lnav-macos-x86_64.zip
# A file, directory or wildcard pattern that describes what to upload
path: |
config.log
src/lnav
- name: Upload macos archive
uses: actions/upload-release-asset@v1.0.2
if: ${{ inputs.upload_url != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: ${{ env.LNAV_ZIPNAME }}
asset_name: ${{ env.LNAV_ZIPNAME }}
asset_content_type: application/octet-stream