From 6bf63e9868793e6bc2851a8b13dc610f263afdc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Fri, 22 Nov 2024 17:22:11 +0000 Subject: [PATCH] ci: automatically add hashes to the release (#564) --- .github/workflows/release.yaml | 55 +++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index de24a4d5c..0d6b55cfa 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -54,8 +54,11 @@ jobs: # make the version available as a "checked" output in later steps echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> "$GITHUB_OUTPUT" - - name: Build in release mode - run: RUSTFLAGS="-D warnings" cargo build --release --locked --package mater-cli + - id: build-release + name: Build in release mode + run: | + RUSTFLAGS="-D warnings" cargo build --release --locked --package mater-cli + echo "PACKAGE_SHA256=$(sha256sum target/release/mater-cli | sed 's/\(.*\) .*/\1/')" >> "$GITHUB_OUTPUT" - name: Login to Github Container Registry uses: docker/login-action@v3 @@ -82,6 +85,10 @@ jobs: tag_name: ${{ github.ref_name }} # set the name of the release the tag body: | Docker container release: https://github.com/eigerco/polka-storage/pkgs/container/mater-cli/?tag=${{ steps.check-version.outputs.PACKAGE_VERSION }} + + | Binary | SHA256 | + | ------------------------ | --------------------------------------------------- | + | `${{ github.ref_name }}` | `${{ steps.build-release.outputs.PACKAGE_SHA256 }}` | files: | target/release/mater-cli @@ -114,8 +121,11 @@ jobs: # make the version available as a "checked" output in later steps echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> "$GITHUB_OUTPUT" - - name: Build in release mode - run: RUSTFLAGS="-D warnings" cargo build --release --locked --package storagext-cli + - id: build-release + name: Build in release mode + run: | + RUSTFLAGS="-D warnings" cargo build --release --locked --package storagext-cli + echo "PACKAGE_SHA256=$(sha256sum target/release/storagext-cli | sed 's/\(.*\) .*/\1/')" >> "$GITHUB_OUTPUT" - name: Login to Github Container Registry uses: docker/login-action@v3 @@ -142,6 +152,10 @@ jobs: tag_name: ${{ github.ref_name }} # set the name of the release the tag body: | Docker container release: https://github.com/eigerco/polka-storage/pkgs/container/storagext-cli/?tag=${{ steps.check-version.outputs.PACKAGE_VERSION }} + + | Binary | SHA256 | + | ------------------------ | --------------------------------------------------- | + | `${{ github.ref_name }}` | `${{ steps.build-release.outputs.PACKAGE_SHA256 }}` | files: | target/release/storagext-cli @@ -174,8 +188,11 @@ jobs: # make the version available as a "checked" output in later steps echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> "$GITHUB_OUTPUT" - - name: Build in release mode - run: RUSTFLAGS="-D warnings" cargo build --release --locked --package polka-storage-node --features polka-storage-runtime/testnet + - id: build-release + name: Build in release mode + run: | + RUSTFLAGS="-D warnings" cargo build --release --locked --package polka-storage-node --features polka-storage-runtime/testnet + echo "PACKAGE_SHA256=$(sha256sum target/release/polka-storage-node | sed 's/\(.*\) .*/\1/')" >> "$GITHUB_OUTPUT" - name: Login to Github Container Registry uses: docker/login-action@v3 @@ -202,6 +219,10 @@ jobs: tag_name: ${{ github.ref_name }} # set the name of the release the tag body: | Docker container release: https://github.com/eigerco/polka-storage/pkgs/container/polka-storage-node/?tag=${{ steps.check-version.outputs.PACKAGE_VERSION }} + + | Binary | SHA256 | + | ------------------------ | --------------------------------------------------- | + | `${{ github.ref_name }}` | `${{ steps.build-release.outputs.PACKAGE_SHA256 }}` | files: | target/release/polka-storage-node @@ -234,8 +255,11 @@ jobs: # make the version available as a "checked" output in later steps echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> "$GITHUB_OUTPUT" - - name: Build in release mode - run: RUSTFLAGS="-D warnings" cargo build --release --locked --package polka-storage-provider-server + - id: build-release + name: Build in release mode + run: | + RUSTFLAGS="-D warnings" cargo build --release --locked --package polka-storage-provider-server + echo "PACKAGE_SHA256=$(sha256sum target/release/polka-storage-provider-server | sed 's/\(.*\) .*/\1/')" >> "$GITHUB_OUTPUT" - name: Login to Github Container Registry uses: docker/login-action@v3 @@ -262,6 +286,10 @@ jobs: tag_name: ${{ github.ref_name }} # set the name of the release the tag body: | Docker container release: https://github.com/eigerco/polka-storage/pkgs/container/polka-storage-provider-server/?tag=${{ steps.check-version.outputs.PACKAGE_VERSION }} + + | Binary | SHA256 | + | ------------------------ | --------------------------------------------------- | + | `${{ github.ref_name }}` | `${{ steps.build-release.outputs.PACKAGE_SHA256 }}` | files: | target/release/polka-storage-provider-server @@ -294,8 +322,11 @@ jobs: # make the version available as a "checked" output in later steps echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> "$GITHUB_OUTPUT" - - name: Build in release mode - run: RUSTFLAGS="-D warnings" cargo build --release --locked --package polka-storage-provider-client + - id: build-release + name: Build in release mode + run: | + RUSTFLAGS="-D warnings" cargo build --release --locked --package polka-storage-provider-client + echo "PACKAGE_SHA256=$(sha256sum target/release/polka-storage-provider-client | sed 's/\(.*\) .*/\1/')" >> "$GITHUB_OUTPUT" - name: Login to Github Container Registry uses: docker/login-action@v3 @@ -322,5 +353,9 @@ jobs: tag_name: ${{ github.ref_name }} # set the name of the release the tag body: | Docker container release: https://github.com/eigerco/polka-storage/pkgs/container/polka-storage-provider-client/?tag=${{ steps.check-version.outputs.PACKAGE_VERSION }} + + | Binary | SHA256 | + | ------------------------ | --------------------------------------------------- | + | `${{ github.ref_name }}` | `${{ steps.build-release.outputs.PACKAGE_SHA256 }}` | files: | target/release/polka-storage-provider-client