Skip to content

fix: Add build step #53

fix: Add build step

fix: Add build step #53

Workflow file for this run

name: Build and publish
on:
push:
tags:
- '*'
jobs:
tests:
uses: ./.github/workflows/tests.yml
build:
needs: [tests]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build Caprine
run: npm run build
- 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: Package 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:
draft: true
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: Package 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:
draft: true
files: |
dist/Caprine-Setup-${{ steps.release_tag.outputs.value }}.exe
dist/Caprine-Setup-${{ steps.release_tag.outputs.value }}.exe.blockmap
dist/latest.yml
- name: Package 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:
draft: true
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
with:
snap: dist/caprine_${{ steps.release_tag.outputs.value }}_amd64.snap
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraft_token }}
- name: Upload to Gemfury
if: startsWith(matrix.os, 'ubuntu')
run: curl -F package=@dist/caprine_${{ steps.release_tag.outputs.value }}_amd64.deb https://${{ secrets.gemfury_token }}@push.fury.io/lefterisgar/