update #26
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: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| env: | |
| NIX_CONFIG: experimental-features = nix-command flakes | |
| 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 | |
| nix_package_url: https://releases.nixos.org/nix/nix-2.18.1/nix-2.18.1-x86_64-linux.tar.xz | |
| - pretty_name: Linux aarch64 | |
| runner: ubuntu-24.04-arm | |
| asset_suffix: linux-aarch64 | |
| artifact: bundle-linux-aarch64 | |
| nix_package_url: https://releases.nixos.org/nix/nix-2.18.1/nix-2.18.1-aarch64-linux.tar.xz | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - name: Install Nix | |
| uses: DeterminateSystems/nix-installer-action@v12 | |
| with: | |
| nix-package-url: ${{ matrix.nix_package_url }} | |
| - name: Ensure derivations stay available | |
| run: | | |
| set -euo pipefail | |
| sudo mkdir -p /etc/nix | |
| for line in \ | |
| "keep-outputs = true" \ | |
| "keep-derivations = true" \ | |
| "download-derivations = true"; do | |
| if ! grep -qF "$line" /etc/nix/nix.conf 2>/dev/null; then | |
| echo "$line" | sudo tee -a /etc/nix/nix.conf >/dev/null | |
| fi | |
| done | |
| sudo systemctl restart nix-daemon || true | |
| - name: Bundle Neovim | |
| run: | | |
| rm -rf bundle | |
| 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 }} |