Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions .github/AppImageBuilder.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/appimage.yml

This file was deleted.

81 changes: 81 additions & 0 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: upload

on:
push:
branches: [master]
release:
types: [published]

jobs:
build-static:
name: build static binary
runs-on: ubuntu-latest
container:
image: ghcr.io/linux-nvme/debian:latest
steps:
- uses: actions/checkout@v4

- name: build
run: |
make static
mkdir upload
cp .build/nvme upload/nvme
if [ "${GITHUB_EVENT_NAME}" = "release" ]; then
VERSION="${GITHUB_REF_NAME#v}"
cp .build/nvme "upload/nvme-${VERSION}"
fi

- uses: actions/upload-artifact@v4
name: upload artifacts to github
with:
name: nvme-cli
path: upload/*

upload-test-binary:
name: upload test binary
runs-on: ubuntu-latest
needs: build-static
if: ${{ github.event_name == 'push' || github.event_name == 'release' }}
steps:
- uses: actions/download-artifact@v4
with:
name: nvme-cli
path: upload

- name: FTP Deployer
uses: sand4rt/[email protected]
with:
sftp: true
host: ${{ secrets.SFTP_SERVER }}
port: 22
username: ${{ secrets.SFTP_USERNAME }}
password: ${{ secrets.SFTP_PASSWORD }}
remote_folder: '/upload'
local_folder: upload
cleanup: false
include: '[ "nvme", "nvme-*" ]'
exclude: '[".github/**", ".git/**", "*.env"]'

upload-release-assets:
name: upload GitHub release assets
runs-on: ubuntu-latest
needs: build-static
if: ${{ github.event_name == 'release' }}
steps:
- uses: actions/download-artifact@v4
with:
name: nvme-cli
path: upload

- name: derive version and rename file
run: |
VERSION="${GITHUB_REF_NAME#v}"
echo "VERSION=${VERSION}" >> $GITHUB_ENV

- name: upload versioned binary
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: upload/nvme-${{ env.VERSION }}
asset_name: nvme-${{ env.VERSION }}
asset_content_type: application/octet-stream