From a73a39647130a19a1fe388196801918532a6436a Mon Sep 17 00:00:00 2001 From: Louis Hildebrand Date: Fri, 29 Dec 2023 16:34:34 -0500 Subject: [PATCH] Simplify release workflow --- .github/workflows/ci.yml | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15961f0..354082c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,17 +30,23 @@ jobs: - run: npm ci - run: npm test - run: npm run lint + - name: Get version + id: fungus-version + uses: martinbeentjes/npm-get-version-action@v1.3.1 + outputs: + - version: ${{ steps.fungus-version.outputs.current-version }} build_release: - if: ${{ inputs.release }} + # TODO + # if: ${{ inputs.release }} needs: test runs-on: ${{ matrix.job.os }} strategy: fail-fast: false matrix: job: - - { os: macos-12 , artifact-name: fungus-gui-macos } - - { os: windows-2022, artifact-name: fungus-gui-windows } - - { os: ubuntu-22.04, artifact-name: fungus-gui-linux } + - { os: macos-12 , artifact-name: macos } + - { os: windows-2022, artifact-name: windows } + - { os: ubuntu-22.04, artifact-name: linux } steps: - name: Check out source code uses: actions/checkout@v4 @@ -50,7 +56,10 @@ jobs: node-version: 18.x cache: 'npm' - run: npm ci - - name: Install dependency for building dmg + - name: Get artifact name + id: artifact-name + run: echo "NAME=fungus-gui-${{ needs.test.outputs.version }}-${{ matrix.job.os-name }}" >> "$GITHUB_OUTPUT" + - name: Install dependencies for building dmg if: runner.os == 'macOS' shell: bash # https://github.com/actions/runner/issues/2958#issuecomment-1852627308 @@ -59,34 +68,34 @@ jobs: - name: Upload zip artifact uses: actions/upload-artifact@v4 with: - name: ${{ matrix.job.artifact-name }}-zip + name: ${{ steps.artifact-name.outputs.NAME }} path: out/make/zip/**/*.zip if-no-files-found: error - name: Upload squirrel artifact if: runner.os == 'Windows' uses: actions/upload-artifact@v4 with: - name: ${{ matrix.job.artifact-name }}-squirrel + name: ${{ steps.artifact-name.outputs.NAME }}-squirrel path: out/make/squirrel.windows/ if-no-files-found: error - name: Upload deb artifact if: runner.os == 'Linux' uses: actions/upload-artifact@v4 with: - name: ${{ matrix.job.artifact-name }}-deb - path: out/make/deb/ + name: ${{ steps.artifact-name.outputs.NAME }} + path: out/make/deb/x64/fungus-gui_${{ needs.test.outputs.version }}_amd64.deb if-no-files-found: error - name: Upload rpm artifact if: runner.os == 'Linux' uses: actions/upload-artifact@v4 with: - name: ${{ matrix.job.artifact-name }}-rpm - path: out/make/rpm/ + name: ${{ steps.artifact-name.outputs.NAME }} + path: out/make/rpm/x64/fungus-gui-${{ needs.test.outputs.version }}-1.x86_64.rpm if-no-files-found: error - name: Upload dmg artifact if: runner.os == 'macOS' uses: actions/upload-artifact@v4 with: - name: ${{ matrix.job.artifact-name }}-dmg - path: out/make/*.dmg + name: ${{ steps.artifact-name.outputs.NAME }} + path: out/make/fungus-gui-${{ needs.test.outputs.version }}-x64.dmg if-no-files-found: error