Skip to content

Commit 2236f57

Browse files
igawMaisenbacherD
andcommitted
build: replace AppImage with static build binary
The AppImage build was introduced to give users access to a test binary. Before the switch to meson, the static build was used for this. In the meantime we figured out how to build a static build with meson, so there is no need for the AppImage workflow. Start to add to the release versions of nvme the tag as postfix. Furthermore, upload the artifacts to github. Signed-off-by: Daniel Wagner <[email protected]> Co-authored-by: Dennis Maisenbacher <[email protected]>
1 parent 346af35 commit 2236f57

File tree

6 files changed

+90
-137
lines changed

6 files changed

+90
-137
lines changed

.github/AppImageBuilder.yml

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

.github/workflows/appimage.yml

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

.github/workflows/upload.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: upload
2+
3+
on:
4+
push:
5+
branches: [master]
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
build-static:
11+
name: build static binary
12+
runs-on: ubuntu-latest
13+
container:
14+
image: ghcr.io/linux-nvme/debian:latest
15+
outputs:
16+
VERSION: ${{ steps.build.outputs.VERSION }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: build
23+
id: build
24+
run: |
25+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
26+
VERSION="$(git describe --always --abbrev=12 --dirty)"
27+
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
28+
echo $VERSION
29+
30+
scripts/build.sh static
31+
mkdir upload
32+
cp .build-ci/nvme upload/nvme-cli-latest-x86_64
33+
if [ "${GITHUB_EVENT_NAME}" = "release" ]; then
34+
cp .build-ci/nvme "upload/nvme-cli-${VERSION}-x86_64"
35+
fi
36+
37+
- uses: actions/upload-artifact@v4
38+
name: upload artifacts to github
39+
with:
40+
name: nvme-cli
41+
path: upload/*
42+
43+
upload-test-binary:
44+
name: upload test binary
45+
runs-on: ubuntu-latest
46+
needs: build-static
47+
if: ${{ github.event_name == 'push' || github.event_name == 'release' }}
48+
steps:
49+
- uses: actions/download-artifact@v4
50+
with:
51+
name: nvme-cli
52+
path: upload
53+
54+
- name: FTP Deployer
55+
uses: sand4rt/[email protected]
56+
with:
57+
sftp: true
58+
host: ${{ secrets.SFTP_SERVER }}
59+
port: 22
60+
username: ${{ secrets.SFTP_USERNAME }}
61+
password: ${{ secrets.SFTP_PASSWORD }}
62+
remote_folder: '/upload'
63+
local_folder: upload
64+
cleanup: false
65+
include: '[ "nvme-cli-*" ]'
66+
exclude: '[".github/**", ".git/**", "*.env"]'
67+
68+
upload-release-assets:
69+
name: upload GitHub release assets
70+
runs-on: ubuntu-latest
71+
needs: build-static
72+
env:
73+
VERSION: ${{ needs.build-static.outputs.VERSION }}
74+
if: ${{ github.event_name == 'release' }}
75+
steps:
76+
- uses: actions/download-artifact@v4
77+
with:
78+
name: nvme-cli
79+
path: upload
80+
- name: upload versioned binary
81+
uses: actions/upload-release-asset@v1
82+
with:
83+
upload_url: ${{ github.event.release.upload_url }}
84+
asset_path: upload/nvme-cli-${{ env.VERSION }}-x86_64
85+
asset_name: nvme-cli-${{ env.VERSION }}-x86_64
86+
asset_content_type: application/octet-stream

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ static:
7171
meson setup ${BUILD-DIR} --buildtype=release \
7272
--wrap-mode=forcefallback \
7373
--default-library=static \
74+
--prefix=/usr \
7475
-Dc_link_args="-static" \
7576
-Dlibnvme:default_library=static \
7677
-Dlibnvme:keyutils=disabled \

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ sees the complete file.
329329

330330
## Testing
331331

332-
For testing purposes a x86_64 AppImage is build from the current HEAD and is
332+
For testing purposes a x86_64 static build from the current HEAD and is
333333
available here:
334334

335-
https://monom.org/linux-nvme/upload/AppImage/nvme-cli-latest-x86_64.AppImage
335+
https://monom.org/linux-nvme/upload/nvme-cli-latest-x86_64

scripts/build.sh

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ usage() {
2121
echo " and build them as shared libraries"
2222
echo " cross use cross toolchain to build"
2323
echo " coverage build coverage report"
24-
echo " appimage build AppImage target"
2524
echo " distro build libnvme and nvme-cli separately"
2625
echo " docs build documentation"
2726
echo " static build a static binary"
@@ -114,16 +113,6 @@ config_meson_coverage() {
114113
"${BUILDDIR}"
115114
}
116115

117-
config_meson_appimage() {
118-
CC="${CC}" "${MESON}" setup \
119-
--werror \
120-
--buildtype="${BUILDTYPE}" \
121-
--force-fallback-for=libnvme \
122-
--prefix=/usr \
123-
-Dlibnvme:werror=false \
124-
"${BUILDDIR}"
125-
}
126-
127116
config_meson_docs() {
128117
CC="${CC}" "${MESON}" setup \
129118
-Ddocs=all \
@@ -139,6 +128,7 @@ config_meson_static() {
139128
--buildtype=release \
140129
--default-library=static \
141130
--wrap-mode=forcefallback \
131+
--prefix=/usr \
142132
-Dc_link_args="-static" \
143133
-Dlibnvme:keyutils=disabled \
144134
"${BUILDDIR}"
@@ -169,11 +159,6 @@ test_meson_coverage() {
169159
ninja -C "${BUILDDIR}" coverage --verbose
170160
}
171161

172-
install_meson_appimage() {
173-
"${MESON}" install \
174-
-C "${BUILDDIR}"
175-
}
176-
177162
install_meson_docs() {
178163
"${MESON}" install \
179164
-C "${BUILDDIR}"

0 commit comments

Comments
 (0)