-
-
Notifications
You must be signed in to change notification settings - Fork 560
59 lines (59 loc) · 1.79 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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/