From 201104c624653a61c08315e543b4f88458b195ff Mon Sep 17 00:00:00 2001 From: D0rkKnight Date: Sun, 17 Dec 2023 21:53:39 -0800 Subject: [PATCH] Restructuring actions again --- .github/workflows/build-and-release.yml | 102 +++++++----------------- 1 file changed, 31 insertions(+), 71 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index c19f6c1..17f94da 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -50,80 +50,40 @@ jobs: - name: Build project run: make build - - name: Rename build artifacts - run: | - mv dist/Palette*.exe dist/Palette-${{matrix.os}}.exe - mv dist/Palette*.dmg dist/Palette-${{matrix.os}}.dmg - mv dist/Palette*.snap dist/Palette-${{matrix.os}}.snap + - name: Store artifacts + uses: actions/upload-artifact@v2 + with: + name: Palette-${{matrix.os}} + path: dist + + release-windows: + needs: build + runs-on: windows-latest + steps: + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: Palette-windows-latest + path: dist - - name: Release Windows/MacOS + - name: Release Windows uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') && (matrix.os == 'windows-latest' || matrix.os == 'macos-latest') + if: startsWith(github.ref, 'refs/tags/') with: files: dist/Palette*.exe - # - name: Upload Windows/MacOS Executable to Artifacts - # if: matrix.os == 'windows-latest' || matrix.os == 'macos-latest' - # uses: actions/upload-artifact@v2 - # with: - # name: palette-${{ matrix.os }} - # path: dist/Palette*.exe - - # - name: Upload Linux Snap to Artifacts - # if: matrix.os == 'ubuntu-latest' - # uses: actions/upload-artifact@v2 - # with: - # name: palette-${{ matrix.os }} - # path: dist/Palette*.snap - - # # From https://dev.to/eugenebabichenko/automated-multi-platform-releases-with-github-actions-1abg - # release: - # name: Create release - # needs: build - # runs-on: ubuntu-latest - # # Note this. We are going to use that in further jobs. - # permissions: - # contents: write - # steps: - # - uses: actions/checkout@v3 - # - uses: ncipollo/release-action@v1 - # with: - # artifacts: "palette-ubuntu-latest,palette-windows-latest,palette-macos-latest" - # # bodyFile: "body.md" - - # release_assets: - # needs: [create_release, build] - # runs-on: ubuntu-latest - # strategy: - # matrix: - # os: [ubuntu-latest, macos-latest, windows-latest] - - # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - - # steps: - # - name: Download Executable Artifact - # uses: actions/download-artifact@v2 - # with: - # name: executable-${{ matrix.os }} - - # - name: Upload Windows/MacOS Assets - # if: matrix.os == 'windows-latest' || matrix.os == 'macos-latest' - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ needs.create_release.outputs.upload_url }} - # asset_path: ./dist/Palette*.exe - # asset_name: palette-${{ matrix.os }}.exe - # asset_content_type: application/octet-stream + release-macos: + needs: build + runs-on: macos-latest + steps: + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: Palette-macos-latest + path: dist - # - name: Upload Linux Assets - # if: matrix.os == 'ubuntu-latest' - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ needs.create_release.outputs.upload_url }} - # asset_path: ./dist/Palette*.snap - # asset_name: palette-${{ matrix.os }}.snap - # asset_content_type: application/octet-stream + - name: Release macOS + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: dist/Palette*.dmg