From ea67ddb2af0b35499bb364a66608d5a4c5a79d00 Mon Sep 17 00:00:00 2001 From: Matthieu Viry Date: Tue, 30 Jul 2024 19:28:51 +0200 Subject: [PATCH] Slightly improve ci workflows --- .github/workflows/docker-image.yml | 2 +- .github/workflows/electron-app.yml | 44 ++++++++++++++++++------------ 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 4b90a55d..52341cdb 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,7 +2,7 @@ name: Build and publish the Docker image of Magrit on new tags on: push: tags: - - '*' + - "v*.*.*" jobs: push_to_registry: name: Push Docker image to Docker Hub diff --git a/.github/workflows/electron-app.yml b/.github/workflows/electron-app.yml index a7c440b5..876c38c7 100644 --- a/.github/workflows/electron-app.yml +++ b/.github/workflows/electron-app.yml @@ -2,8 +2,8 @@ name: Build the Electron version of Magrit on: push: -# tags: -# - '*' + tags: + - "v*.*.*" branches: - dev @@ -42,18 +42,27 @@ jobs: id: get_version run: echo "::set-output name=version::$(node -p -e "require('./package.json').version")" - - name: Upload artifacts + - name: Upload .exe artifacts + uses: actions/upload-artifact@v2 + with: + name: windows-build + path: release/${{ steps.get_version.outputs.version }}/*.exe + + - name: Upload .AppImage artifacts uses: actions/upload-artifact@v2 with: - name: linux-windows-build - path: release/${{ steps.get_version.outputs.version }}/*.{exe,AppImage} + name: linux-build + path: release/${{ steps.get_version.outputs.version }}/*.AppImage -# - name: Upload Linux and Windows Artifacts to Release -# uses: softprops/action-gh-release@v1 -# with: -# files: release/${{ steps.get_version.outputs.version }}/*.{exe,AppImage} -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Artifacts to Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + release/${{ steps.get_version.outputs.version }}/Magrit-Windows-${{ steps.get_version.outputs.version }}-portable.exe + release/${{ steps.get_version.outputs.version }}/Magrit-Linux-${{ steps.get_version.outputs.version }}.AppImage + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} build-macos: runs-on: macos-latest @@ -89,9 +98,10 @@ jobs: name: macos-build path: release/${{ steps.get_version.outputs.version }}/*.dmg -# - name: Upload macOS Artifacts to Release -# uses: softprops/action-gh-release@v1 -# with: -# files: release/${{ steps.get_version.outputs.version }}/*.dmg -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload macOS Artifacts to Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: release/${{ steps.get_version.outputs.version }}/Magrit-Mac-${{ steps.get_version.outputs.version }}-Installer.dmg + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}