From b2f19cda7cde071a882895f5a501a197595a1f49 Mon Sep 17 00:00:00 2001 From: Eric Swanson <64809312+ericswanson-dfinity@users.noreply.github.com> Date: Mon, 28 Feb 2022 12:43:33 -0800 Subject: [PATCH] chore: release workflow: check contents of macos binary tarball (#22) `tar` is broken on macos... yeah I don't really know how that's possible either. --- .github/workflows/release.yml | 87 +++++++++++++++++++++++++++++------ 1 file changed, 74 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3421aa1..d8e277b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,20 +80,81 @@ jobs: - name: Create tarball of binaries run: tar -zcC ${{ matrix.binary_path }} -f binaries.tar.gz icx-proxy - - name: Upload tarball - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: binaries.tar.gz - asset_name: binaries-${{ matrix.name }}.tar.gz - tag: ${{ env.SHA_SHORT }} + - name: Inspect input binary and tarball contents + run: | + hexdump -C ${{ matrix.binary_path }}/icx-proxy | head + hexdump -C ${{ matrix.binary_path }}/icx-proxy | tail + ${{ matrix.binary_path }}/icx-proxy --help + + ARCHIVE="$(pwd)/binaries.tar.gz" + cd "$(mktemp -d)" + tar --version + tar -xzvf "$ARCHIVE" + ls -l icx-proxy + hexdump -C icx-proxy | head + hexdump -C icx-proxy | tail + ./icx-proxy --help - - name: Upload deb - uses: svenstaro/upload-release-action@v2 + - name: Upload tarball artifact + uses: actions/upload-artifact@v2 + with: + name: tarball-${{ matrix.name }} + path: binaries.tar.gz + - name: Copy deb artifact + run: cp target/x86_64-unknown-linux-musl/debian/icx-proxy_${{ env.ICX_VERSION }}_amd64.deb icx-proxy.deb + if: contains(matrix.target, 'linux-musl') + - name: Upload deb artifact + uses: actions/upload-artifact@v2 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: target/x86_64-unknown-linux-musl/debian/icx-proxy_${{ env.ICX_VERSION }}_amd64.deb - asset_name: icx-proxy.deb - tag: ${{ env.SHA_SHORT }} + name: deb-${{ matrix.name }} + path: icx-proxy.deb if: contains(matrix.target, 'linux-musl') + upload: + runs-on: ${{ matrix.os }} + needs: [ build ] + strategy: + fail-fast: false + matrix: + rust: [ '1.55.0' ] + target: [ x86_64-apple-darwin, x86_64-unknown-linux-musl, x86_64-unknown-linux-gnu ] + include: + - os: macos-latest + target: x86_64-apple-darwin + name: macos + - os: ubuntu-latest + target: x86_64-unknown-linux-musl + name: linux + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + name: linux-gnu + steps: + - name: Setup environment variables + run: echo "SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV + + - name: Download tarball artifact + uses: actions/download-artifact@v2 + with: + name: tarball-${{ matrix.name }} + - name: Download deb artifact + uses: actions/download-artifact@v2 + with: + name: deb-${{ matrix.name }} + if: contains(matrix.target, 'linux-musl') + + - name: Upload tarball + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: binaries.tar.gz + asset_name: binaries-${{ matrix.name }}.tar.gz + tag: ${{ env.SHA_SHORT }} + + - name: Upload deb + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: icx-proxy.deb + tag: ${{ env.SHA_SHORT }} + if: contains(matrix.target, 'linux-musl') +