From 84c9a7cfdb28bab92750ca9423c6a4e78c509705 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Sun, 23 May 2021 22:09:22 +0800 Subject: [PATCH] Upload SHA256 sums as artifacts --- .github/workflows/build.yml | 50 ++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6829669699..95d42847a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -133,17 +133,21 @@ jobs: - run: ccache -s - run: ../tests/basic.sh out/Release/naive - run: mkdir ${{ env.BUNDLE }} && cp out/Release/naive config.json ../LICENSE ../USAGE.txt ${{ env.BUNDLE }} - - run: tar cJf ${{ env.BUNDLE }}.tar.xz ${{ env.BUNDLE }} + - run: tar cJf ../${{ env.BUNDLE }}.tar.xz ${{ env.BUNDLE }} - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: src/${{ env.BUNDLE }}.tar.xz + asset_path: ${{ env.BUNDLE }}.tar.xz asset_name: ${{ env.BUNDLE }}.tar.xz asset_content_type: application/octet-stream - - run: openssl sha256 out/Release/naive + - run: openssl sha256 out/Release/naive >../${{ env.BUNDLE }}.sha256sum.txt + - uses: actions/upload-artifact@v2 + with: + name: sha256sums + path: ${{ env.BUNDLE }}.sha256sum.txt android: needs: cache-toolchains-posix runs-on: ubuntu-latest @@ -198,17 +202,21 @@ jobs: # qemu-user segfaults with x64 or x86 android builds here. if: ${{ matrix.arch != 'x64' && matrix.arch != 'x86' }} - run: mkdir ${{ env.BUNDLE }} && cp out/Release/naive config.json ../LICENSE ../USAGE.txt ${{ env.BUNDLE }} - - run: tar cJf ${{ env.BUNDLE }}.tar.xz ${{ env.BUNDLE }} + - run: tar cJf ../${{ env.BUNDLE }}.tar.xz ${{ env.BUNDLE }} - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: src/${{ env.BUNDLE }}.tar.xz + asset_path: ${{ env.BUNDLE }}.tar.xz asset_name: ${{ env.BUNDLE }}.tar.xz asset_content_type: application/octet-stream - - run: openssl sha256 out/Release/naive + - run: openssl sha256 out/Release/naive >../${{ env.BUNDLE }}.sha256sum.txt + - uses: actions/upload-artifact@v2 + with: + name: sha256sums + path: ${{ env.BUNDLE }}.sha256sum.txt win: needs: cache-toolchains-win runs-on: windows-latest @@ -258,17 +266,21 @@ jobs: # No real or emulated environment is available to test this. if: ${{ matrix.arch != 'arm64' }} - run: mkdir ${{ env.BUNDLE }} && cp out/Release/naive.exe config.json ../LICENSE ../USAGE.txt ${{ env.BUNDLE }} - - run: 7z a ${{ env.BUNDLE }}.zip ${{ env.BUNDLE }} + - run: 7z a ../${{ env.BUNDLE }}.zip ${{ env.BUNDLE }} - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: src/${{ env.BUNDLE }}.zip + asset_path: ${{ env.BUNDLE }}.zip asset_name: ${{ env.BUNDLE }}.zip asset_content_type: application/octet-stream - - run: openssl sha256 out/Release/naive.exe + - run: openssl sha256 out/Release/naive.exe >../${{ env.BUNDLE }}.sha256sum.txt + - uses: actions/upload-artifact@v2 + with: + name: sha256sums + path: ${{ env.BUNDLE }}.sha256sum.txt mac: needs: cache-toolchains-mac runs-on: macos-latest @@ -307,17 +319,21 @@ jobs: # No real or emulated environment is available to test this. if: ${{ matrix.arch != 'arm64' }} - run: mkdir ${{ env.BUNDLE }} && cp out/Release/naive config.json ../LICENSE ../USAGE.txt ${{ env.BUNDLE }} - - run: tar cJf ${{ env.BUNDLE }}.tar.xz ${{ env.BUNDLE }} + - run: tar cJf ../${{ env.BUNDLE }}.tar.xz ${{ env.BUNDLE }} - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: src/${{ env.BUNDLE }}.tar.xz + asset_path: ${{ env.BUNDLE }}.tar.xz asset_name: ${{ env.BUNDLE }}.tar.xz asset_content_type: application/octet-stream - - run: openssl sha256 out/Release/naive + - run: openssl sha256 out/Release/naive >../${{ env.BUNDLE }}.sha256sum.txt + - uses: actions/upload-artifact@v2 + with: + name: sha256sums + path: ${{ env.BUNDLE }}.sha256sum.txt openwrt: needs: cache-toolchains-posix runs-on: ubuntu-latest @@ -427,14 +443,18 @@ jobs: - run: ccache -s - run: ../tests/basic.sh out/Release/naive - run: mkdir ${{ env.BUNDLE }} && cp out/Release/naive config.json ../LICENSE ../USAGE.txt ${{ env.BUNDLE }} - - run: tar cJf ${{ env.BUNDLE }}.tar.xz ${{ env.BUNDLE }} + - run: tar cJf ../${{ env.BUNDLE }}.tar.xz ${{ env.BUNDLE }} - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: src/${{ env.BUNDLE }}.tar.xz + asset_path: ${{ env.BUNDLE }}.tar.xz asset_name: ${{ env.BUNDLE }}.tar.xz asset_content_type: application/octet-stream - - run: openssl sha256 out/Release/naive + - run: openssl sha256 out/Release/naive >../${{ env.BUNDLE }}.sha256sum.txt + - uses: actions/upload-artifact@v2 + with: + name: sha256sums + path: ${{ env.BUNDLE }}.sha256sum.txt