6 - '[0-9]+.[0-9]+.[0-9]+'
11 runs-on: ubuntu-latest
13 - name: Checkout sources
14 uses: actions/checkout@v3
16 - name: Install stable toolchain
17 uses: helix-editor/rust-toolchain@v1
22 - uses: Swatinem/rust-cache@v1
24 - name: Fetch tree-sitter grammars
25 uses: actions-rs/cargo@v1
28 args: --package=helix-loader --bin=hx-loader
30 - name: Bundle grammars
31 run: tar cJf grammars.tar.xz -C runtime/grammars/sources .
33 - uses: actions/upload-artifact@v3
40 needs: [fetch-grammars]
41 runs-on: ${{ matrix.os }}
43 fail-fast: false # don't fail other jobs if one fails
45 build: [x86_64-linux, x86_64-macos, x86_64-windows] #, x86_64-win-gnu, win32-msvc
50 target: x86_64-unknown-linux-gnu
52 # - build: aarch64-linux
55 # target: aarch64-unknown-linux-gnu
60 target: x86_64-apple-darwin
62 - build: x86_64-windows
65 target: x86_64-pc-windows-msvc
67 - build: aarch64-macos
70 target: aarch64-apple-darwin
72 skip_tests: true # x86_64 host can't run aarch64 code
73 # - build: x86_64-win-gnu
75 # rust: stable-x86_64-gnu
76 # target: x86_64-pc-windows-gnu
80 # target: i686-pc-windows-msvc
83 - name: Checkout sources
84 uses: actions/checkout@v3
86 - name: Download grammars
87 uses: actions/download-artifact@v3
89 - name: Move grammars under runtime
90 if: "!startsWith(matrix.os, 'windows')"
92 mkdir -p runtime/grammars/sources
93 tar xJf grammars/grammars.tar.xz -C runtime/grammars/sources
95 - name: Install ${{ matrix.rust }} toolchain
96 uses: actions-rs/toolchain@v1
99 toolchain: ${{ matrix.rust }}
100 target: ${{ matrix.target }}
103 - name: Run cargo test
104 uses: actions-rs/cargo@v1
105 if: "!matrix.skip_tests"
107 use-cross: ${{ matrix.cross }}
109 args: --release --locked --target ${{ matrix.target }} --workspace
111 - name: Build release binary
112 uses: actions-rs/cargo@v1
114 use-cross: ${{ matrix.cross }}
116 args: --release --locked --target ${{ matrix.target }}
118 - name: Strip release binary (linux and macos)
119 if: matrix.build == 'x86_64-linux' || endsWith(matrix.build, 'macos')
120 run: strip "target/${{ matrix.target }}/release/hx"
122 - name: Strip release binary (arm)
123 if: matrix.build == 'aarch64-linux'
126 "$PWD/target:/target:Z" \
127 rustembedded/cross:${{ matrix.target }} \
128 aarch64-linux-gnu-strip \
129 /target/${{ matrix.target }}/release/hx
131 - name: Build AppImage
133 if: matrix.build == 'x86_64-linux'
138 if [[ $GITHUB_REF == refs/tags/* ]]; then
139 name=${GITHUB_REF:10}
142 export VERSION="$name"
145 export OUTPUT="helix-$VERSION-$ARCH.AppImage"
146 export UPDATE_INFORMATION="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|helix|latest|$APP-*-$ARCH.AppImage.zsync"
148 mkdir -p "$APP.AppDir"/usr/{bin,lib/helix}
150 cp "target/${{ matrix.target }}/release/hx" "$APP.AppDir/usr/bin/hx"
151 rm -rf runtime/grammars/sources
152 cp -r runtime "$APP.AppDir/usr/lib/helix/runtime"
154 cat << 'EOF' > "$APP.AppDir/AppRun"
157 APPDIR="$(dirname "$(readlink -f "${0}")")"
158 HELIX_RUNTIME="$APPDIR/usr/lib/helix/runtime" exec "$APPDIR/usr/bin/hx" "$@"
160 chmod 755 "$APP.AppDir/AppRun"
162 curl -Lo linuxdeploy-x86_64.AppImage \
163 https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
164 chmod +x linuxdeploy-x86_64.AppImage
166 ./linuxdeploy-x86_64.AppImage \
167 --appdir "$APP.AppDir" -d contrib/Helix.desktop \
168 -i contrib/helix.png --output appimage
170 mv "$APP-$VERSION-$ARCH.AppImage" \
171 "$APP-$VERSION-$ARCH.AppImage.zsync" dist
173 - name: Build archive
177 if [ "${{ matrix.os }}" = "windows-2019" ]; then
178 cp "target/${{ matrix.target }}/release/hx.exe" "dist/"
180 cp "target/${{ matrix.target }}/release/hx" "dist/"
182 if [ -d runtime/grammars/sources ]; then
183 rm -rf runtime/grammars/sources
187 - uses: actions/upload-artifact@v3
189 name: bins-${{ matrix.build }}
195 runs-on: ubuntu-latest
197 - name: Checkout sources
198 uses: actions/checkout@v3
200 - uses: actions/download-artifact@v3
202 - name: Calculate tag name
205 if [[ $GITHUB_REF == refs/tags/* ]]; then
206 name=${GITHUB_REF:10}
208 echo ::set-output name=val::$name
209 echo TAG=$name >> $GITHUB_ENV
212 - name: Build archive
218 mkdir -p runtime/grammars/sources
219 tar xJf grammars/grammars.tar.xz -C runtime/grammars/sources
226 for dir in bins-* ; do
227 platform=${dir#"bins-"}
228 if [[ $platform =~ "windows" ]]; then
231 pkgname=helix-$TAG-$platform
233 cp $source/LICENSE $source/README.md $pkgname
234 mkdir $pkgname/contrib
235 cp -r $source/contrib/completion $pkgname/contrib
236 mv bins-$platform/runtime $pkgname/
237 mv bins-$platform/hx$exe $pkgname
238 chmod +x $pkgname/hx$exe
240 if [[ "$platform" = "x86_64-linux" ]]; then
241 mv bins-$platform/helix-*.AppImage* dist/
244 if [ "$exe" = "" ]; then
245 tar cJf dist/$pkgname.tar.xz $pkgname
247 7z a -r dist/$pkgname.zip $pkgname
251 tar cJf dist/helix-$TAG-source.tar.xz -C $source .
254 - name: Upload binaries to release
255 uses: svenstaro/upload-release-action@v2
257 repo_token: ${{ secrets.GITHUB_TOKEN }}
260 tag: ${{ steps.tagname.outputs.val }}
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