From 6ef4f27d325253e127ccf3c64faf4a54c727f384 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 1/2] Upload release assets automatically as well --- .github/workflows/build-binary-packages.yml | 35 +++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-binary-packages.yml b/.github/workflows/build-binary-packages.yml index ccc7dd7d77..4c4e137df4 100644 --- a/.github/workflows/build-binary-packages.yml +++ b/.github/workflows/build-binary-packages.yml @@ -56,19 +56,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/octet-stream + # --- 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 @@ -99,15 +109,25 @@ 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 + asset_content_type: application/octet-stream + # --- 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 @@ -188,3 +208,12 @@ 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 }} + asset_content_type: application/octet-stream From 1867bfc8a1676ba50d5bbff3024615730d03528b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Sun, 25 Jul 2021 11:08:21 +0800 Subject: [PATCH 2/2] Rename packages based on git tag --- .github/workflows/build-binary-packages.yml | 27 +++++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-binary-packages.yml b/.github/workflows/build-binary-packages.yml index 4c4e137df4..493d5e7747 100644 --- a/.github/workflows/build-binary-packages.yml +++ b/.github/workflows/build-binary-packages.yml @@ -60,12 +60,16 @@ jobs: path: dist/gf_*.deb if-no-files-found: error + - name: Rename package for specific ubuntu version + run: | + mv dist/gf_*.deb dist/gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb + - 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_path: dist/gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb asset_name: gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb asset_content_type: application/octet-stream @@ -105,17 +109,21 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v2 with: - name: gf-${{ github.sha }}-macos + name: gf-${{ github.event.release.tag_name }}-macos path: dist/gf-*.pkg if-no-files-found: error + + - name: Rename package + run: | + mv dist/gf-*.pkg dist/gf-${{ github.event.release.tag_name }}-macos.pkg - 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 + asset_path: dist/gf-${{ github.event.release.tag_name }}-macos.pkg + asset_name: gf-${{ github.event.release.tag_name }}-macos.pkg asset_content_type: application/octet-stream # --- @@ -205,15 +213,18 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v2 with: - name: gf-${{ github.sha }}-windows + name: gf-${{ github.event.release.tag_name }}-windows path: C:\tmp-dist\* if-no-files-found: error + - name: Create archive + run: | + Compress-Archive C:\tmp-dist C:\gf-${{ github.event.release.tag_name }}-windows.zip - 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 }} - asset_content_type: application/octet-stream + asset_path: C:\gf-${{ github.event.release.tag_name }}-windows.zip + asset_name: gf-${{ github.event.release.tag_name }}-windows.zip + asset_content_type: application/zip