-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (92 loc) · 3.09 KB
/
Copy pathrelease.yml
File metadata and controls
105 lines (92 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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 }}