Use nix-portable directly in CI #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Bundles | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| bundle: | |
| name: Bundle ${{ matrix.pretty_name }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - pretty_name: Linux x86_64 | |
| runner: ubuntu-24.04 | |
| asset_suffix: linux-x86_64 | |
| artifact: bundle-linux-x86_64 | |
| - pretty_name: Linux aarch64 | |
| runner: ubuntu-24.04-arm | |
| asset_suffix: linux-aarch64 | |
| artifact: bundle-linux-aarch64 | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - name: Download nix-portable | |
| run: | | |
| set -euo pipefail | |
| curl -L https://github.com/DavHau/nix-portable/releases/latest/download/nix-portable-$(uname -m) -o nix-portable | |
| chmod +x nix-portable | |
| - name: Build Neovim | |
| run: ./nix-portable nix build .#nvim | |
| - name: Bundle Neovim | |
| run: | | |
| rm -rf bundle | |
| ./nix-portable nix bundle --bundler github:DavHau/nix-portable#zstd-max -o bundle .#nvim | |
| - name: Package bundle | |
| run: | | |
| set -euo pipefail | |
| mkdir -p release | |
| archive="nathomvim-${{ matrix.asset_suffix }}.tar.gz" | |
| tar -czf "release/$archive" -C bundle . | |
| shasum -a 256 "release/$archive" > "release/$archive.sha256" | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: | | |
| release/nathomvim-${{ matrix.asset_suffix }}.tar.gz | |
| release/nathomvim-${{ matrix.asset_suffix }}.tar.gz.sha256 | |
| release: | |
| name: Publish GitHub Release | |
| needs: bundle | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: bundle-* | |
| merge-multiple: true | |
| path: release | |
| - name: List release payload | |
| run: ls -R release | |
| - name: Derive short commit hash | |
| run: echo "SHORT_SHA=${GITHUB_SHA::12}" >> "$GITHUB_ENV" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: push-${{ github.run_id }}-${{ github.run_attempt }} | |
| name: nathomvim-nightly-${{ env.SHORT_SHA }} | |
| target_commitish: ${{ github.sha }} | |
| files: | | |
| release/**/*.tar.gz | |
| release/**/*.tar.gz.sha256 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |