Skip to content

Commit

Permalink
Restructuring actions again
Browse files Browse the repository at this point in the history
  • Loading branch information
shouhanzen committed Dec 18, 2023
1 parent 9a714a7 commit 201104c
Showing 1 changed file with 31 additions and 71 deletions.
102 changes: 31 additions & 71 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 201104c

Please sign in to comment.