From 0af8a7b04c74608a189df405ead49e470ae373a8 Mon Sep 17 00:00:00 2001 From: tserg <8017125+tserg@users.noreply.github.com> Date: Tue, 30 May 2023 09:04:26 +0800 Subject: [PATCH] try win --- .github/workflows/build.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2b63e9967..8a58cb40f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Artifacts +name: Build artifacts on: workflow_dispatch: @@ -6,10 +6,10 @@ on: tag: default: '' push: - tags: - - '*' branches: - master + release: + types: [released] defaults: run: @@ -47,6 +47,17 @@ jobs: with: path: dist/vyper.* + - name: Publish release assets + if: ${{ github.event_name == 'release' }} + run: | + export BIN_NAME=$(ls dist/vyper.* | xargs basename) && \ + curl -L \ + -X POST \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\ + -H "Content-Type: application/octet-stream" \ + "https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=${BIN_NAME}" \ + --data-binary "@dist/${BIN_NAME}" + windows-build: runs-on: windows-latest @@ -74,3 +85,15 @@ jobs: uses: actions/upload-artifact@v3 with: path: dist/vyper.* + + - name: Publish release assets + if: ${{ github.event_name == 'release' }} + shell: bash + run: | + export BIN_NAME=$(ls dist/vyper.* | xargs basename) + curl -L \ + -X POST \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\ + -H "Content-Type: application/octet-stream" \ + https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.payload.release.release_id }}/assets?name=$(BIN_NAME) \ + --data-binary "@$(BIN_NAME)" \ No newline at end of file