Skip to content

Commit

Permalink
Updated release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziothh committed Nov 13, 2023
1 parent 24fb171 commit 5d38443
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- "v*.*.*"
workflow_dispatch:

env:
BIN_CRATE_NAME: bin
LIB_NAME: ntr

jobs:
build-release:
needs: create-release
Expand Down Expand Up @@ -38,6 +42,11 @@ jobs:
rust: stable
target: aarch64-apple-darwin
steps:
- name: Echo env variables
run: |
echo "BIN_CRATE_NAME: $BIN_CRATE_NAME"
echo "LIB_NAME: $LIB_NAME"
- name: Set release tag
run: |
if [ "$GITHUB_EVENT_NAME" == 'workflow_dispatch' ]; then
Expand Down Expand Up @@ -79,31 +88,31 @@ jobs:

- name: Build release binary
# run: cargo xtask ci cross ${{ matrix.target }}
run: cargo build --release --target=${{ matrix.target }}
run: cargo build -p "$BIN_CRATE_NAME" --release --target=${{ matrix.target }}

# this breaks on aarch64 and this if conditional isn't working for some reason: TODO: investigate
#- name: Strip release binary
# if: runner.target != 'aarch64-unknown-linux-musl' && runner.target != 'aarch64-apple-darwin'
# run: strip "target/${{ matrix.target }}/release/zellij"
# run: strip "target/${{ matrix.target }}/release/$BIN_CRATE_NAME"

- name: Create checksum
id: make-checksum
working-directory: ./target/${{ matrix.target }}/release
run: |
name="zellij-${{ matrix.target }}.sha256sum"
name="$LIB_NAME-${{ matrix.target }}.sha256sum"
if [[ "$RUNNER_OS" != "macOS" ]]; then
sha256sum "zellij" > "${name}"
sha256sum "$LIB_NAME" > "${name}"
else
shasum -a 256 "zellij" > "${name}"
shasum -a 256 "$LIB_NAME" > "${name}"
fi
echo "::set-output name=name::${name}"
- name: Tar release
id: make-artifact
working-directory: ./target/${{ matrix.target }}/release
run: |
name="zellij-${{ matrix.target }}.tar.gz"
tar cvzf "${name}" "zellij"
name="$LIB_NAME-${{ matrix.target }}.tar.gz"
tar cvzf "${name}" "$LIB_NAME"
echo "::set-output name=name::${name}"
- name: Upload release archive
Expand Down

0 comments on commit 5d38443

Please sign in to comment.