diff --git a/.github/AppImageBuilder.yml b/.github/AppImageBuilder.yml deleted file mode 100644 index cce46890c4..0000000000 --- a/.github/AppImageBuilder.yml +++ /dev/null @@ -1,57 +0,0 @@ -# appimage-builder recipe see https://appimage-builder.readthedocs.io for details -version: 1 -script: - # Ensure that the mksquashfs tool is installed (workaround for the AppImageCrafters/build-appimage GHA) - - which mksquashfs || apt install squashfs-tools - # fake icons - - mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps - - touch AppDir/usr/share/icons/hicolor/64x64/apps/nvme-cli.png - -AppDir: - path: AppDir - app_info: - id: linux-nvme.nvme-cli - name: nvme-cli - version: latest - icon: nvme-cli - exec: usr/sbin/nvme - exec_args: $@ - apt: - arch: amd64 - allow_unauthenticated: true - sources: - - sourceline: deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse - key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C' - - sourceline: deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse - - sourceline: deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse - - sourceline: deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse - include: - - libjson-c5 - - libssl3 - files: - include: - - libcrypt.so.3 - - libdbus-1.so.3 - - libjson-c.so.5 - exclude: - - usr/share/man - - usr/share/doc - test: - fedora-30: - image: appimagecrafters/tests-env:fedora-30 - command: ./AppRun - debian-stable: - image: appimagecrafters/tests-env:debian-stable - command: ./AppRun - archlinux-latest: - image: appimagecrafters/tests-env:archlinux-latest - command: ./AppRun - centos-7: - image: appimagecrafters/tests-env:centos-7 - command: ./AppRun - ubuntu-xenial: - image: appimagecrafters/tests-env:ubuntu-xenial - command: ./AppRun -AppImage: - update-information: 'gh-releases-zsync|linux-nvme|nvme-cli|latest|*x86_64.AppImage.zsync' - arch: x86_64 diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml deleted file mode 100644 index 9768c70c9d..0000000000 --- a/.github/workflows/appimage.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -name: appimage - -on: - push: - branches: [master] - pull_request: - branches: [master] -env: - DESTDIR: ../AppDir - -jobs: - build-appimage: - name: build AppImage - runs-on: ubuntu-latest - container: - image: ghcr.io/linux-nvme/debian:latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: fixup permissions - env: - GITHUB_WORKSPACE: ${{ github.workspace }} - run: | - git config --global --add safe.directory "${GITHUB_WORKSPACE}" - - name: build - run: | - scripts/build.sh appimage - - name: build AppImage - uses: AppImageCrafters/build-appimage@v1.3 - with: - recipe: .github/AppImageBuilder.yml - - uses: actions/upload-artifact@v4 - name: upload artifacts to github - with: - name: AppImage - path: '*.AppImage*' - - deploy-appimage: - name: deploy AppImage - runs-on: ubuntu-latest - needs: build-appimage - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'linux-nvme/nvme-cli' }} - steps: - - uses: actions/download-artifact@v4 - with: - name: AppImage - path: AppImage - - name: FTP Deployer - uses: sand4rt/ftp-deployer@v1.8 - with: - sftp: true - host: ${{ secrets.SFTP_SERVER }} - port: 22 - username: ${{ secrets.SFTP_USERNAME }} - password: ${{ secrets.SFTP_PASSWORD }} - remote_folder: '/upload' - local_folder: '.' - cleanup: false - include: '[ "*", "**/*" ]' - exclude: '[".github/**", ".git/**", "*.env"]' diff --git a/.github/workflows/upload.yml b/.github/workflows/upload.yml new file mode 100644 index 0000000000..6e15977163 --- /dev/null +++ b/.github/workflows/upload.yml @@ -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/ftp-deployer@v1.8 + 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