diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b9aee1..6485d0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ concurrency: cancel-in-progress: true jobs: - cargo-build: + build-release-archive: permissions: contents: write strategy: @@ -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: >- @@ -91,7 +77,7 @@ jobs: cargo-deb: permissions: contents: write - needs: cargo-build + needs: build-release-archive strategy: fail-fast: false matrix: @@ -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 }} @@ -140,7 +126,7 @@ jobs: attestations: write contents: write needs: - - cargo-build + - build-release-archive - cargo-deb runs-on: ubuntu-latest env: @@ -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 @@ -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 }}