Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to '.github/workflows/release.yml')
| -rw-r--r-- | .github/workflows/release.yml | 78 |
1 files changed, 36 insertions, 42 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7331a2dc..b483e3af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v5 + uses: actions/checkout@v4 - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable @@ -36,7 +36,7 @@ jobs: - name: Bundle grammars run: tar cJf grammars.tar.xz -C runtime/grammars/sources . - - uses: actions/upload-artifact@v5 + - uses: actions/upload-artifact@v4 with: name: grammars path: grammars.tar.xz @@ -58,21 +58,23 @@ jobs: strategy: fail-fast: false # don't fail other jobs if one fails matrix: - build: [x86_64-linux, aarch64-linux, x86_64-macos, x86_64-windows, aarch64-macos] #, x86_64-win-gnu, win32-msvc + build: [x86_64-linux, x86_64-macos, x86_64-windows] #, x86_64-win-gnu, win32-msvc include: - build: x86_64-linux - # WARN: When changing this to a newer version, make sure that the GLIBC isnt too new, as this can cause issues - # with portablity on older systems that dont follow ubuntus more rapid release cadence. - os: ubuntu-22.04 + os: ubuntu-latest rust: stable target: x86_64-unknown-linux-gnu cross: false - build: aarch64-linux - # Version should be kept in lockstep with the x86_64 version - os: ubuntu-22.04-arm + os: ubuntu-latest rust: stable target: aarch64-unknown-linux-gnu - cross: false + cross: true + # - build: riscv64-linux + # os: ubuntu-latest + # rust: stable + # target: riscv64gc-unknown-linux-gnu + # cross: true - build: x86_64-macos os: macos-latest rust: stable @@ -83,16 +85,13 @@ jobs: rust: stable target: x86_64-pc-windows-msvc cross: false + # 23.03: build issues - build: aarch64-macos os: macos-latest rust: stable target: aarch64-apple-darwin cross: false - # - build: riscv64-linux - # os: ubuntu-22.04 - # rust: stable - # target: riscv64gc-unknown-linux-gnu - # cross: true + skip_tests: true # x86_64 host can't run aarch64 code # - build: x86_64-win-gnu # os: windows-2019 # rust: stable-x86_64-gnu @@ -104,16 +103,16 @@ jobs: steps: - name: Checkout sources - uses: actions/checkout@v5 + uses: actions/checkout@v4 - name: Download grammars - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v4 - name: Move grammars under runtime if: "!startsWith(matrix.os, 'windows')" run: | mkdir -p runtime/grammars/sources - tar xJf grammars.tar.xz -C runtime/grammars/sources + tar xJf grammars/grammars.tar.xz -C runtime/grammars/sources # The rust-toolchain action ignores rust-toolchain.toml files. # Removing this before building with cargo ensures that the rust-toolchain @@ -148,8 +147,16 @@ jobs: if: "!matrix.skip_tests" run: ${{ env.CARGO }} test --release --locked --target ${{ matrix.target }} --workspace + - name: Set profile.release.strip = true + shell: bash + run: | + cat >> .cargo/config.toml <<EOF + [profile.release] + strip = true + EOF + - name: Build release binary - run: ${{ env.CARGO }} build --profile opt --locked --target ${{ matrix.target }} + run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }} - name: Build AppImage shell: bash @@ -176,7 +183,7 @@ jobs: mkdir -p "$APP.AppDir"/usr/{bin,lib/helix} - cp "target/${{ matrix.target }}/opt/hx" "$APP.AppDir/usr/bin/hx" + cp "target/${{ matrix.target }}/release/hx" "$APP.AppDir/usr/bin/hx" rm -rf runtime/grammars/sources cp -r runtime "$APP.AppDir/usr/lib/helix/runtime" @@ -199,32 +206,21 @@ jobs: mv "$APP-$VERSION-$ARCH.AppImage" \ "$APP-$VERSION-$ARCH.AppImage.zsync" dist - - name: Build Deb - shell: bash - if: matrix.build == 'x86_64-linux' - run: | - cargo install cargo-deb - mkdir -p target/release - cp target/${{ matrix.target }}/opt/hx target/release/ - cargo deb --no-build - mkdir -p dist - mv target/debian/*.deb dist/ - - name: Build archive shell: bash run: | mkdir -p dist - if [ "${{ matrix.os }}" = "windows-latest" ]; then - cp "target/${{ matrix.target }}/opt/hx.exe" "dist/" + if [ "${{ matrix.os }}" = "windows-2019" ]; then + cp "target/${{ matrix.target }}/release/hx.exe" "dist/" else - cp "target/${{ matrix.target }}/opt/hx" "dist/" + cp "target/${{ matrix.target }}/release/hx" "dist/" fi if [ -d runtime/grammars/sources ]; then rm -rf runtime/grammars/sources fi cp -r runtime dist - - uses: actions/upload-artifact@v5 + - uses: actions/upload-artifact@v4 with: name: bins-${{ matrix.build }} path: dist @@ -235,9 +231,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v5 + uses: actions/checkout@v4 - - uses: actions/download-artifact@v6 + - uses: actions/download-artifact@v4 - name: Build archive shell: bash @@ -245,7 +241,6 @@ jobs: set -ex source="$(pwd)" - tag=${GITHUB_REF_NAME//\//} mkdir -p runtime/grammars/sources tar xJf grammars/grammars.tar.xz -C runtime/grammars/sources rm -rf grammars @@ -259,7 +254,7 @@ jobs: if [[ $platform =~ "windows" ]]; then exe=".exe" fi - pkgname=helix-$tag-$platform + pkgname=helix-$GITHUB_REF_NAME-$platform mkdir -p $pkgname cp $source/LICENSE $source/README.md $pkgname mkdir $pkgname/contrib @@ -270,7 +265,6 @@ jobs: if [[ "$platform" = "x86_64-linux" ]]; then mv bins-$platform/helix-*.AppImage* dist/ - mv bins-$platform/*.deb dist/ fi if [ "$exe" = "" ]; then @@ -280,7 +274,7 @@ jobs: fi done - tar cJf dist/helix-$tag-source.tar.xz -C $source . + tar cJf dist/helix-$GITHUB_REF_NAME-source.tar.xz -C $source . mv dist $source/ - name: Upload binaries to release @@ -292,9 +286,9 @@ jobs: file_glob: true tag: ${{ github.ref_name }} overwrite: true - + - name: Upload binaries as artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v4 if: env.preview == 'true' with: name: release |