6 - '[0-9]+.[0-9]+.[0-9]+'
11 - '.github/workflows/release.yml'
14 # Preview mode: Publishes the build output as a CI artifact instead of creating
15 # a release, allowing for manual inspection of the output. This mode is
16 # activated if the CI run was triggered by events other than pushed tags, or
17 # if the repository is a fork.
18 preview: ${{ !startsWith(github.ref, 'refs/tags/') || github.repository != 'helix-editor/helix' }}
23 runs-on: ubuntu-latest
25 - name: Checkout sources
26 uses: actions/checkout@v3
28 - name: Install stable toolchain
29 uses: dtolnay/rust-toolchain@stable
31 - uses: Swatinem/rust-cache@v2
33 - name: Fetch tree-sitter grammars
34 run: cargo run --package=helix-loader --bin=hx-loader
36 - name: Bundle grammars
37 run: tar cJf grammars.tar.xz -C runtime/grammars/sources .
39 - uses: actions/upload-artifact@v3
46 needs: [fetch-grammars]
48 # For some builds, we use cross to test on 32-bit and big-endian
51 # When CARGO is set to CROSS, this is set to `--target matrix.target`.
53 # When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
55 # Emit backtraces on panics.
57 runs-on: ${{ matrix.os }}
59 fail-fast: false # don't fail other jobs if one fails
61 build: [x86_64-linux, x86_64-macos, x86_64-windows] #, x86_64-win-gnu, win32-msvc
66 target: x86_64-unknown-linux-gnu
68 - build: aarch64-linux
71 target: aarch64-unknown-linux-gnu
73 - build: riscv64-linux
76 target: riscv64gc-unknown-linux-gnu
81 target: x86_64-apple-darwin
83 - build: x86_64-windows
86 target: x86_64-pc-windows-msvc
88 - build: aarch64-macos
91 target: aarch64-apple-darwin
93 skip_tests: true # x86_64 host can't run aarch64 code
94 # - build: x86_64-win-gnu
96 # rust: stable-x86_64-gnu
97 # target: x86_64-pc-windows-gnu
101 # target: i686-pc-windows-msvc
104 - name: Checkout sources
105 uses: actions/checkout@v3
107 - name: Download grammars
108 uses: actions/download-artifact@v3
110 - name: Move grammars under runtime
111 if: "!startsWith(matrix.os, 'windows')"
113 mkdir -p runtime/grammars/sources
114 tar xJf grammars/grammars.tar.xz -C runtime/grammars/sources
116 - name: Install ${{ matrix.rust }} toolchain
117 uses: dtolnay/rust-toolchain@master
119 toolchain: ${{ matrix.rust }}
120 target: ${{ matrix.target }}
122 # Install a pre-release version of Cross
123 # TODO: We need to pre-install Cross because we need cross-rs/cross#591 to
124 # get a newer C++ compiler toolchain. Remove this step when Cross
125 # 0.3.0, which includes cross-rs/cross#591, is released.
126 - name: Install Cross
129 cargo install cross --git https://github.com/cross-rs/cross.git --rev 47df5c76e7cba682823a0b6aa6d95c17b31ba63a
130 echo "CARGO=cross" >> $GITHUB_ENV
131 # echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
132 # echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
134 - name: Show command used for Cargo
136 echo "cargo command is: ${{ env.CARGO }}"
137 echo "target flag is: ${{ env.TARGET_FLAGS }}"
139 - name: Run cargo test
140 if: "!matrix.skip_tests"
141 run: ${{ env.CARGO }} test --release --locked --target ${{ matrix.target }} --workspace
143 - name: Set profile.release.strip = true
146 cat >> .cargo/config.toml <<EOF
151 - name: Build release binary
152 run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }}
154 - name: Build AppImage
156 if: matrix.build == 'aarch64-linux' || matrix.build == 'x86_64-linux'
161 if [[ $GITHUB_REF == refs/tags/* ]]; then
162 name=${GITHUB_REF:10}
165 build="${{ matrix.build }}"
167 export VERSION="$name"
168 export ARCH=${build%-linux}
170 export OUTPUT="helix-$VERSION-$ARCH.AppImage"
171 export UPDATE_INFORMATION="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|helix|latest|$APP-*-$ARCH.AppImage.zsync"
173 mkdir -p "$APP.AppDir"/usr/{bin,lib/helix}
175 cp "target/${{ matrix.target }}/release/hx" "$APP.AppDir/usr/bin/hx"
176 rm -rf runtime/grammars/sources
177 cp -r runtime "$APP.AppDir/usr/lib/helix/runtime"
179 cat << 'EOF' > "$APP.AppDir/AppRun"
182 APPDIR="$(dirname "$(readlink -f "${0}")")"
183 HELIX_RUNTIME="$APPDIR/usr/lib/helix/runtime" exec "$APPDIR/usr/bin/hx" "$@"
185 chmod 755 "$APP.AppDir/AppRun"
187 curl -Lo linuxdeploy-x86_64.AppImage \
188 https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
189 chmod +x linuxdeploy-x86_64.AppImage
191 ./linuxdeploy-x86_64.AppImage \
192 --appdir "$APP.AppDir" -d contrib/Helix.desktop \
193 -i contrib/helix.png --output appimage
195 mv "$APP-$VERSION-$ARCH.AppImage" \
196 "$APP-$VERSION-$ARCH.AppImage.zsync" dist
198 - name: Build archive
202 if [ "${{ matrix.os }}" = "windows-2019" ]; then
203 cp "target/${{ matrix.target }}/release/hx.exe" "dist/"
205 cp "target/${{ matrix.target }}/release/hx" "dist/"
207 if [ -d runtime/grammars/sources ]; then
208 rm -rf runtime/grammars/sources
212 - uses: actions/upload-artifact@v3
214 name: bins-${{ matrix.build }}
220 runs-on: ubuntu-latest
222 - name: Checkout sources
223 uses: actions/checkout@v3
225 - uses: actions/download-artifact@v3
227 - name: Build archive
233 mkdir -p runtime/grammars/sources
234 tar xJf grammars/grammars.tar.xz -C runtime/grammars/sources
241 for dir in bins-* ; do
242 platform=${dir#"bins-"}
243 if [[ $platform =~ "windows" ]]; then
246 pkgname=helix-$GITHUB_REF_NAME-$platform
248 cp $source/LICENSE $source/README.md $pkgname
249 mkdir $pkgname/contrib
250 cp -r $source/contrib/completion $pkgname/contrib
251 mv bins-$platform/runtime $pkgname/
252 mv bins-$platform/hx$exe $pkgname
253 chmod +x $pkgname/hx$exe
255 if [[ "$platform" = "aarch64-linux" || "$platform" = "x86_64-linux" ]]; then
256 mv bins-$platform/helix-*.AppImage* dist/
259 if [ "$exe" = "" ]; then
260 tar cJf dist/$pkgname.tar.xz $pkgname
262 7z a -r dist/$pkgname.zip $pkgname
266 tar cJf dist/helix-$GITHUB_REF_NAME-source.tar.xz -C $source .
269 - name: Upload binaries to release
270 uses: svenstaro/upload-release-action@v2
271 if: env.preview == 'false'
273 repo_token: ${{ secrets.GITHUB_TOKEN }}
276 tag: ${{ github.ref_name }}
279 - name: Upload binaries as artifact
280 uses: actions/upload-artifact@v3
281 if: env.preview == 'true'
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list