diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7224c222..5558ab382 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,18 +22,6 @@ 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 @@ -41,6 +29,52 @@ jobs: 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 @@ -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/ diff --git a/package.json b/package.json index 656bf3cad..3684a6ac3 100644 --- a/package.json +++ b/package.json @@ -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": {