Skip to content
This repository was archived by the owner on Dec 2, 2025. It is now read-only.

Commit 181ea33

Browse files
committed
Add CI
1 parent 96d7cce commit 181ea33

File tree

3 files changed

+117
-10
lines changed

3 files changed

+117
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
runs-on: linux-arm64
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- uses: DeterminateSystems/nix-installer-action@main
16+
- uses: DeterminateSystems/magic-nix-cache-action@main
17+
18+
- name: Test Linux ARM64
19+
run: |
20+
nix build .#cursor.linux.arm64-targz
21+
file result/*
22+
nix build .#cursor.linux.arm64-appimage
23+
file result/*
24+
rm -rf result
25+
26+
- name: Test Linux ARM32 builds
27+
run: |
28+
nix build .#cursor.linux.arm32-targz
29+
file result/*
30+
nix build .#cursor.linux.arm32-appimage
31+
file result/*
32+
rm -rf result
33+
34+
- name: Test Windows ARM64 build
35+
run: |
36+
nix build .#cursor.windows.arm64-zip
37+
file result/*
38+
rm -rf result
39+
40+
- name: Test Nix build
41+
run: |
42+
nix build .#cursor.nix
43+
cd result && ls -alh

.github/workflows/release.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
release:
14+
runs-on: linux-arm64
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- uses: DeterminateSystems/nix-installer-action@main
19+
- uses: DeterminateSystems/magic-nix-cache-action@main
20+
21+
- name: Build Linux ARM64
22+
run: |
23+
mkdir -p artifacts
24+
nix build .#cursor.linux.arm64-targz
25+
cp result/* artifacts/
26+
nix build .#cursor.linux.arm64-appimage
27+
cp result/* artifacts/
28+
29+
- name: Build Linux ARM32
30+
run: |
31+
nix build .#cursor.linux.arm32-targz
32+
cp result/* artifacts/
33+
nix build .#cursor.linux.arm32-appimage
34+
cp result/* artifacts/
35+
36+
- name: Build Windows ARM64
37+
run: |
38+
nix build .#cursor.windows.arm64-zip
39+
cp result/* artifacts/
40+
41+
- name: Create Release
42+
id: create_release
43+
uses: actions/create-release@v1
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
with:
47+
tag_name: ${{ github.ref }}
48+
release_name: Release ${{ github.ref }}
49+
draft: true
50+
prerelease: false
51+
52+
- name: Upload Release Assets
53+
uses: softprops/action-gh-release@v1
54+
with:
55+
files: ./artifacts/*
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

flake.nix

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
cp -R ${cursorSrc}/resources/app/resources ${root}/resources/app/
5656
'';
5757

58+
artifactName = os: arch: ext: "cursor_${cursorVersion}_${os}_${arch}.${ext}";
59+
5860
# Overrides the VS Code package with Cursor's resources.
5961
buildCursorNix = { vscodePackage }:
6062
vscodePackage.overrideAttrs (oldAttrs: {
@@ -129,43 +131,43 @@
129131
name = "linux-arm64";
130132
};
131133
arm64-appimage = pkgs.stdenv.mkDerivation {
132-
name = "cursor-linux-arm64-appimage";
134+
name = artifactName "linux" "arm64" "AppImage";
133135
src = self.packages.${system}.cursor.linux.arm64;
134136
dontPatchShebangs = true;
135137
buildInputs = [ pkgs.appimagekit ];
136138
buildPhase = ''
137139
mkdir -p $out
138-
ARCH=arm_aarch64 appimagetool $src $out/cursor.AppImage
139-
chmod +x $out/cursor.AppImage
140-
patchelf --set-interpreter /lib/ld-linux-aarch64.so.1 $out/cursor.AppImage
140+
ARCH=arm_aarch64 appimagetool $src $out/${artifactName "linux" "arm64" "AppImage"}
141+
chmod +x $out/${artifactName "linux" "arm64" "AppImage"}
142+
patchelf --set-interpreter /lib/ld-linux-aarch64.so.1 $out/${artifactName "linux" "arm64" "AppImage"}
141143
'';
142144
};
143145
arm64-targz = pkgs.runCommand "tarball" { } ''
144146
mkdir -p $out
145147
cd ${self.packages.${system}.cursor.linux.arm64}
146-
${pkgs.gnutar}/bin/tar -czvf $out/cursor-linux-arm64-${cursorVersion}.tar.gz .
148+
${pkgs.gnutar}/bin/tar -czvf $out/${artifactName "linux" "arm64" "tar.gz"} .
147149
'';
148150

149151
arm32 = buildCursorPrepackaged {
150152
vscodeFiles = vscodeLinuxArm32;
151153
name = "linux-arm32";
152154
};
153155
arm32-appimage = pkgs.stdenv.mkDerivation {
154-
name = "cursor-linux-arm32-appimage";
156+
name = artifactName "linux" "arm32" "AppImage";
155157
src = self.packages.${system}.cursor.linux.arm32;
156158
dontPatchShebangs = true;
157159
buildInputs = [ pkgs.appimagekit ];
158160
buildPhase = ''
159161
mkdir -p $out
160-
ARCH=arm appimagetool $src $out/cursor.AppImage
161-
chmod +x $out/cursor.AppImage
162-
patchelf --set-interpreter /lib/ld-linux.so.3 $out/cursor.AppImage
162+
ARCH=arm appimagetool $src $out/${artifactName "linux" "arm32" "AppImage"}
163+
chmod +x $out/${artifactName "linux" "arm32" "AppImage"}
164+
patchelf --set-interpreter /lib/ld-linux.so.3 $out/${artifactName "linux" "arm32" "AppImage"}
163165
'';
164166
};
165167
arm32-targz = pkgs.runCommand "tarball" { } ''
166168
mkdir -p $out
167169
cd ${self.packages.${system}.cursor.linux.arm32}
168-
${pkgs.gnutar}/bin/tar -czvf $out/cursor-linux-arm32-${cursorVersion}.tar.gz .
170+
${pkgs.gnutar}/bin/tar -czvf $out/${artifactName "linux" "arm32" "tar.gz"} .
169171
'';
170172
};
171173
windows = {
@@ -174,6 +176,11 @@
174176
name = "windows-arm64";
175177
isWindows = true;
176178
};
179+
arm64-zip = pkgs.runCommand "zip" { } ''
180+
mkdir -p $out
181+
cd ${self.packages.${system}.cursor.windows.arm64}
182+
${pkgs.zip}/bin/zip -r $out/${artifactName "windows" "arm64" "zip"} .
183+
'';
177184
};
178185

179186
nix = buildCursorNix {

0 commit comments

Comments
 (0)