fix: Bring back publish config #57
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Package Caprine for Windows | |
if: startsWith(matrix.os, 'windows') | |
run: npm run dist:win | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Package Caprine for Linux | |
if: startsWith(matrix.os, 'ubuntu') | |
run: npm run dist:linux | |
env: | |
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraft_token }} | |
GH_TOKEN: ${{ secrets.GITHUB_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/ |