From 3daf334dcc72bc9c3b3eaaaaaa0e33e977730a48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Thu, 22 Jul 2021 09:23:16 +0800 Subject: [PATCH] Upload release assets automatically as well --- .github/workflows/build-binary-packages.yml | 33 +++++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-binary-packages.yml b/.github/workflows/build-binary-packages.yml index 6693af1f23..4db62cfb90 100644 --- a/.github/workflows/build-binary-packages.yml +++ b/.github/workflows/build-binary-packages.yml @@ -55,19 +55,29 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v2 with: - name: gf-${{ github.sha }}-${{ matrix.os }} + name: gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb path: dist/gf_*.deb if-no-files-found: error + - uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: dist/gf_*.deb + asset_name: gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb + # asset_content_type: application/gzip + # --- macos: name: Build macOS package - runs-on: macos-10.15 strategy: matrix: ghc: ["8.6.5"] cabal: ["2.4"] + os: ["macos-10.15"] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -98,15 +108,24 @@ jobs: path: dist/gf-*.pkg if-no-files-found: error + - uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: dist/gf_*.pkg + asset_name: gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb + # --- windows: name: Build Windows package - runs-on: windows-2019 strategy: matrix: ghc: ["8.6.5"] cabal: ["2.4"] + os: ["windows-2019"] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -185,3 +204,11 @@ jobs: name: gf-${{ github.sha }}-windows path: C:\tmp-dist\* if-no-files-found: error + + - uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: C:\tmp-dist\* + asset_name: gf-${{ github.event.release.tag_name }}-${{ matrix.os }}