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: helix-editor/rust-toolchain@v1
34 - uses: Swatinem/rust-cache@v1
36 - name: Fetch tree-sitter grammars
37 uses: actions-rs/cargo@v1
40 args: --package=helix-loader --bin=hx-loader
42 - name: Bundle grammars
43 run: tar cJf grammars.tar.xz -C runtime/grammars/sources .
45 - uses: actions/upload-artifact@v3
52 needs: [fetch-grammars]
53 runs-on: ${{ matrix.os }}
55 fail-fast: false # don't fail other jobs if one fails
57 build: [x86_64-linux, x86_64-macos, x86_64-windows] #, x86_64-win-gnu, win32-msvc
62 target: x86_64-unknown-linux-gnu
64 - build: aarch64-linux
67 target: aarch64-unknown-linux-gnu
69 - build: riscv64-linux
72 target: riscv64gc-unknown-linux-gnu
77 target: x86_64-apple-darwin
79 - build: x86_64-windows
82 target: x86_64-pc-windows-msvc
84 - build: aarch64-macos
87 target: aarch64-apple-darwin
89 skip_tests: true # x86_64 host can't run aarch64 code
90 # - build: x86_64-win-gnu
92 # rust: stable-x86_64-gnu
93 # target: x86_64-pc-windows-gnu
97 # target: i686-pc-windows-msvc
100 - name: Checkout sources
101 uses: actions/checkout@v3
103 - name: Download grammars
104 uses: actions/download-artifact@v3
106 - name: Move grammars under runtime
107 if: "!startsWith(matrix.os, 'windows')"
109 mkdir -p runtime/grammars/sources
110 tar xJf grammars/grammars.tar.xz -C runtime/grammars/sources
112 - name: Install ${{ matrix.rust }} toolchain
113 uses: actions-rs/toolchain@v1
116 toolchain: ${{ matrix.rust }}
117 target: ${{ matrix.target }}
120 # Install a pre-release version of Cross
121 # TODO: We need to pre-install Cross because we need cross-rs/cross#591 to
122 # get a newer C++ compiler toolchain. Remove this step when Cross
123 # 0.3.0, which includes cross-rs/cross#591, is released.
124 - name: Install Cross
126 run: cargo install cross --git https://github.com/cross-rs/cross.git --rev 47df5c76e7cba682823a0b6aa6d95c17b31ba63a
128 - name: Run cargo test
129 uses: actions-rs/cargo@v1
130 if: "!matrix.skip_tests"
132 use-cross: ${{ matrix.cross }}
134 args: --release --locked --target ${{ matrix.target }} --workspace
136 - name: Set profile.release.strip = true
139 cat >> .cargo/config.toml <<EOF
144 - name: Build release binary
145 uses: actions-rs/cargo@v1
147 use-cross: ${{ matrix.cross }}
149 args: --release --locked --target ${{ matrix.target }}
151 - name: Build AppImage
153 if: matrix.build == 'aarch64-linux' || matrix.build == 'x86_64-linux'
158 if [[ $GITHUB_REF == refs/tags/* ]]; then
159 name=${GITHUB_REF:10}
162 build="${{ matrix.build }}"
164 export VERSION="$name"
165 export ARCH=${build%-linux}
167 export OUTPUT="helix-$VERSION-$ARCH.AppImage"
168 export UPDATE_INFORMATION="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|helix|latest|$APP-*-$ARCH.AppImage.zsync"
170 mkdir -p "$APP.AppDir"/usr/{bin,lib/helix}
172 cp "target/${{ matrix.target }}/release/hx" "$APP.AppDir/usr/bin/hx"
173 rm -rf runtime/grammars/sources
174 cp -r runtime "$APP.AppDir/usr/lib/helix/runtime"
176 cat << 'EOF' > "$APP.AppDir/AppRun"
179 APPDIR="$(dirname "$(readlink -f "${0}")")"
180 HELIX_RUNTIME="$APPDIR/usr/lib/helix/runtime" exec "$APPDIR/usr/bin/hx" "$@"
182 chmod 755 "$APP.AppDir/AppRun"
184 curl -Lo linuxdeploy-x86_64.AppImage \
185 https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
186 chmod +x linuxdeploy-x86_64.AppImage
188 ./linuxdeploy-x86_64.AppImage \
189 --appdir "$APP.AppDir" -d contrib/Helix.desktop \
190 -i contrib/helix.png --output appimage
192 mv "$APP-$VERSION-$ARCH.AppImage" \
193 "$APP-$VERSION-$ARCH.AppImage.zsync" dist
195 - name: Build archive
199 if [ "${{ matrix.os }}" = "windows-2019" ]; then
200 cp "target/${{ matrix.target }}/release/hx.exe" "dist/"
202 cp "target/${{ matrix.target }}/release/hx" "dist/"
204 if [ -d runtime/grammars/sources ]; then
205 rm -rf runtime/grammars/sources
209 - uses: actions/upload-artifact@v3
211 name: bins-${{ matrix.build }}
217 runs-on: ubuntu-latest
219 - name: Checkout sources
220 uses: actions/checkout@v3
222 - uses: actions/download-artifact@v3
224 - name: Calculate tag name
227 if [[ $GITHUB_REF == refs/tags/* ]]; then
228 name=${GITHUB_REF:10}
230 echo ::set-output name=val::$name
231 echo TAG=$name >> $GITHUB_ENV
234 - name: Build archive
240 mkdir -p runtime/grammars/sources
241 tar xJf grammars/grammars.tar.xz -C runtime/grammars/sources
248 for dir in bins-* ; do
249 platform=${dir#"bins-"}
250 if [[ $platform =~ "windows" ]]; then
253 pkgname=helix-$TAG-$platform
255 cp $source/LICENSE $source/README.md $pkgname
256 mkdir $pkgname/contrib
257 cp -r $source/contrib/completion $pkgname/contrib
258 mv bins-$platform/runtime $pkgname/
259 mv bins-$platform/hx$exe $pkgname
260 chmod +x $pkgname/hx$exe
262 if [[ "$platform" = "aarch64-linux" || "$platform" = "x86_64-linux" ]]; then
263 mv bins-$platform/helix-*.AppImage* dist/
266 if [ "$exe" = "" ]; then
267 tar cJf dist/$pkgname.tar.xz $pkgname
269 7z a -r dist/$pkgname.zip $pkgname
273 tar cJf dist/helix-$TAG-source.tar.xz -C $source .
276 - name: Upload binaries to release
277 uses: svenstaro/upload-release-action@v2
278 if: env.preview == 'false'
280 repo_token: ${{ secrets.GITHUB_TOKEN }}
283 tag: ${{ steps.tagname.outputs.val }}
286 - name: Upload binaries as artifact
287 uses: actions/upload-artifact@v3
288 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