Skip to content

Commit

Permalink
Use just recipe to build release archive in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
SRv6d committed Dec 18, 2024
1 parent f1bb434 commit 3ad8a70
Showing 1 changed file with 8 additions and 22 deletions.
30 changes: 8 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: true

jobs:
cargo-build:
build-release-archive:
permissions:
contents: write
strategy:
Expand Down Expand Up @@ -64,22 +64,8 @@ jobs:
cargo -V
rustc -V
- name: Build
run: cargo build --release --locked --target ${{ matrix.target }}

- name: Create Release Tar Archive
run: >-
tar -czvf "${ARCHIVE_FILENAME}"
-C target/${{ matrix.target }}/release
hanko
shell: bash
if: ${{ !startsWith(matrix.os, 'windows') }}
- name: Create Release Zip Archive
run: >-
7z a "${ARCHIVE_FILENAME}"
./target/${{ matrix.target }}/release/hanko.exe
shell: bash
if: ${{ startsWith(matrix.os, 'windows') }}
- name: Create Release Archive
run: just release-archive ${{ matrix.target }} ${{ env.ARCHIVE_FILENAME }}

- name: Upload Release Archive
run: >-
Expand All @@ -91,7 +77,7 @@ jobs:
cargo-deb:
permissions:
contents: write
needs: cargo-build
needs: build-release-archive
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -119,7 +105,7 @@ jobs:
- name: Download Release Binary
run: >-
gh release download ${GITHUB_REF_NAME} --pattern "*${{ matrix.target }}.tar.gz"
--output - | tar -xz -C ${TARGET_DIR}/release
--output - | tar -xz hanko -C ${TARGET_DIR}/release
env:
GITHUB_TOKEN: ${{ github.token }}

Expand All @@ -140,7 +126,7 @@ jobs:
attestations: write
contents: write
needs:
- cargo-build
- build-release-archive
- cargo-deb
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -178,7 +164,7 @@ jobs:
platform: linux/amd64
- target: aarch64-unknown-linux-musl
platform: linux/arm64
needs: cargo-build
needs: build-release-archive
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
Expand All @@ -204,7 +190,7 @@ jobs:
- name: Download Release Binary
run: >-
gh release download ${GITHUB_REF_NAME} --pattern "*${{ matrix.target }}.tar.gz"
--output - | tar -xz
--output - | tar -xz hanko
env:
GITHUB_TOKEN: ${{ github.token }}

Expand Down

0 comments on commit 3ad8a70

Please sign in to comment.