From abadc82a2ad5d328401437e231034de05b483b65 Mon Sep 17 00:00:00 2001 From: Jonathan Acetolyne Langlois Date: Wed, 3 Jan 2024 18:59:01 -0800 Subject: [PATCH] add all binaries to cache and upload each to release draft --- .github/workflows/build.yml | 47 ++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94d7400..0781122 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,8 +40,7 @@ mkdir bin/flowcat-linux-amd64 go test release_test.go if [ `echo $?` -ne 0 ]; then exit 1; fi - ls bin - ls bin/flowcat-linux-amd64/ + echo "KEY ${{ runner.os }}-${{ hashFiles('bin/flowcat-darwin-arm64/flowcat') }}" - name: upload-darwin-arm64-cache id: darwin-arm64-cache @@ -54,19 +53,25 @@ #key: ${{ runner.os }}-${{ hashFiles('bin/flowcat-darwin-arm64/flowcat') }} key: test - # - name: upload-linux-386-artifact - # uses: actions/upload-artifact@v3 - # with: - # name: flowcat-linux-386 - # path: | - # ${{ github.workspace }}/bin/flowcat-linux-386/flowcat + - name: upload-linux-386-cache + id: linux-386-cache + uses: actions/cache/save@v3 + with: + path: | + bin + bin/* + bin/flowcat-linux-386/flowcat + key: test - # - name: upload-linux-amd64-artifact - # uses: actions/upload-artifact@v3 - # with: - # name: flowcat-linux-amd64 - # path: | - # ${{ github.workspace }}/bin/flowcat-linux-amd64/flowcat + - name: upload-linux-amd64-cache + id: linux-amd64-cache + uses: actions/cache/save@v3 + with: + path: | + bin + bin/* + bin/flowcat-linux-amd64/flowcat + key: test release: @@ -112,6 +117,20 @@ name: "flowcat-darwin-arm64", data: await fs.readFileSync("bin/flowcat-darwin-arm64/flowcat") }); + await github.rest.repos.uploadReleaseAsset({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: response.data.id, + name: "flowcat-linux-386", + data: await fs.readFileSync("bin/flowcat-linux-386/flowcat") + }); + await github.rest.repos.uploadReleaseAsset({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: response.data.id, + name: "flowcat-linux-amd64", + data: await fs.readFileSync("bin/flowcat-linux-amd64/flowcat") + }); core.exportVariable('RELEASE_ID', response.data.id); core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url); } catch (error) {