Skip to content

Commit 690ea45

Browse files
committed
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]>
1 parent c417356 commit 690ea45

3 files changed

Lines changed: 92 additions & 119 deletions

File tree

.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/testbinary.yml

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

0 commit comments

Comments
 (0)