Skip to content

Commit

Permalink
fix: Replace electron builder action
Browse files Browse the repository at this point in the history
  • Loading branch information
dusansimic committed Apr 3, 2024
1 parent c60376e commit 31231c2
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 13 deletions.
60 changes: 47 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,59 @@ jobs:
with:
node-version: 20
cache: 'npm'
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
if: startsWith(matrix.os, 'ubuntu')
- name: Build & publish Caprine
uses: samuelmeuli/action-electron-builder@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
mac_certs: ${{ secrets.CSC_LINK }}
mac_certs_password: ${{ secrets.CSC_KEY_PASSWORD }}
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraft_token }}
- name: Cleanup tag
uses: mad9000/actions-find-and-replace-string@5
id: release_tag
with:
source: ${{ github.ref_name }}
find: v
replace: ''
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
if: startsWith(matrix.os, 'ubuntu')
- name: Build Caprine for macOS
if: startsWith(matrix.os, 'macos')
run: npm run dist:mac
env:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
- name: Publish Caprine for macOS
if: startsWith(matrix.os, 'macos')
uses: softprops/action-gh-release@v2
with:
files: |
dist/Caprine-${{ steps.release_tag.outputs.value }}-arm64-mac.zip
dist/Caprine-${{ steps.release_tag.outputs.value }}-arm64-mac.zip.blockmap
dist/Caprine-${{ steps.release_tag.outputs.value }}-arm64.dmg
dist/Caprine-${{ steps.release_tag.outputs.value }}-arm64.dmg.blockmap
dist/Caprine-${{ steps.release_tag.outputs.value }}-mac.zip
dist/Caprine-${{ steps.release_tag.outputs.value }}-mac.zip.blockmap
dist/Caprine-${{ steps.release_tag.outputs.value }}.dmg
dist/Caprine-${{ steps.release_tag.outputs.value }}.dmg.blockmap
dist/latest-mac.yml
- name: Build Caprine for Windows
if: startsWith(matrix.os, 'windows')
run: npm run dist:win
- name: Publish Caprine for Windows
if: startsWith(matrix.os, 'windows')
uses: softprops/action-gh-release@v2
with:
files: |
dist/Caprine-Setup-${{ steps.release_tag.outputs.value }}.exe
dist/Caprine-Setup-${{ steps.release_tag.outputs.value }}.exe.blockmap
dist/latest.yml
- name: Build Caprine for Linux
if: startsWith(matrix.os, 'ubuntu')
run: npm run dist:linux
- name: Publish Caprine for Linux
if: startsWith(matrix.os, 'ubuntu')
uses: softprops/action-gh-release@v2
with:
files: |
dist/Caprine-${{ steps.release_tag.outputs.value }}.AppImage
dist/caprine_${{ steps.release_tag.outputs.value }}_amd64.deb
dist/caprine_${{ steps.release_tag.outputs.value }}_amd64.snap
dist/latest-linux.yml
- name: Upload to Snapcraft
if: startsWith(matrix.os, 'ubuntu')
uses: snapcore/action-publish@v1
Expand All @@ -50,4 +84,4 @@ jobs:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraft_token }}
- name: Upload to Gemfury
if: startsWith(matrix.os, 'ubuntu')
run: curl -F package=@$(find . -type f -name "*.deb") https://${{ secrets.gemfury_token }}@push.fury.io/lefterisgar/
run: curl -F package=@dist/caprine_${{ steps.release_tag.outputs.value }}_amd64.deb https://${{ secrets.gemfury_token }}@push.fury.io/lefterisgar/
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"test": "npm run test:tsc && npm run lint",
"start": "tsc && electron .",
"build": "tsc",
"dist:linux": "electron-builder --linux AppImage deb snap",
"dist:mac": "electron-builder --mac",
"dist:win": "electron-builder --win",
"release": "np --no-publish"
},
"dependencies": {
Expand Down

0 comments on commit 31231c2

Please sign in to comment.