forked from blurymind/YarnClassic
-
Notifications
You must be signed in to change notification settings - Fork 3
65 lines (53 loc) · 2.41 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
60
61
62
63
64
65
name: Build
on: [workflow_dispatch]
jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
build-task: build-windows
- os: ubuntu-latest
build-task: build-linux
- os: macos-latest
build-task: build-mac
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- run: npm ci
- name: Read package.json
uses: tyankatsu0105/read-package-version-actions@v1
id: package-version
- name: Set environment vars for Windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
echo "ARTIFACT_FILE=./electron/dist/Crochet Setup ${{ steps.package-version.outputs.version }}.exe" >> $env:GITHUB_ENV
echo "ARTIFACT_NAME=Crochet.Setup.${{ steps.package-version.outputs.version }}.exe" >> $env:GITHUB_ENV
- name: Set environment vars for Linux
if: matrix.os == 'ubuntu-latest'
run: |
echo "ARTIFACT_FILE=./electron/dist/crochet_${{ steps.package-version.outputs.version }}_amd64.snap" >> $GITHUB_ENV
echo "ARTIFACT_NAME=Crochet.Setup.${{ steps.package-version.outputs.version }}.snap" >> $GITHUB_ENV
- name: Set environment vars for Mac
if: matrix.os == 'macos-latest'
run: |
echo "ARTIFACT_FILE=./electron/dist/Crochet-${{ steps.package-version.outputs.version }}.dmg" >> $GITHUB_ENV
echo "ARTIFACT_NAME=Crochet.Setup.${{ steps.package-version.outputs.version }}.dmg" >> $GITHUB_ENV
- name: npm install and build
run: cd electron && npm install && npm run ${{ matrix.build-task }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Archive artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_FILE }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}