From c897906e54b059995de1077dfbed6e50bf0baf26 Mon Sep 17 00:00:00 2001 From: Jac Date: Mon, 4 Mar 2024 14:27:10 -0800 Subject: [PATCH] Auto-trigger build and upload binaries when a release is created Tested in another repo: https://github.com/jacalata/tabcmd/actions --- .github/workflows/package.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 34d84b67..5d7132d9 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -9,8 +9,9 @@ name: Release-Executable # https://anshumanfauzdar.medium.com/using-github-actions-to-bundle-python-application-into-a-single-package-and-automatic-release-834bd42e0670 on: - release: - types: [published] + push: + tags: + - '*' workflow_dispatch: jobs: @@ -70,3 +71,12 @@ jobs: with: name: ${{ matrix.OUT_FILE_NAME }} path: ./dist/${{ matrix.TARGET }}/${{ matrix.OUT_FILE_NAME }} + + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./dist/${{ matrix.TARGET }}/${{ matrix.OUT_FILE_NAME }}/ + tag: ${{ github.ref_name }} + overwrite: true + promote: true