-
-
Notifications
You must be signed in to change notification settings - Fork 3
131 lines (130 loc) · 4.03 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: shared action - build electron
on:
workflow_call:
inputs:
runner:
description: "image to run the build on"
required: true
type: string
target:
description: "mac/win/linux"
required: true
type: string
branch:
description: "branch to check out all repos at"
required: true
type: string
exe_name:
description: "basename of the final executable"
required: true
type: string
tag_name:
description: "the tag of the current release"
required: true
type: string
build_version:
description: "override for package.log version"
required: false
type: string
sign:
description: "sign executable"
required: false
type: boolean
notarize:
description: "notarize osx executable"
required: false
type: boolean
default: false
release_type:
description: "draft, prerelease, release"
required: false
type: string
default: "draft"
jobs:
build:
runs-on: ${{ inputs.runner }}
steps:
- name: checkout cables_dev
uses: actions/checkout@v4
with:
repository: "cables-gl/cables_dev"
ref: ${{ inputs.branch }}
token: ${{ secrets.standalone_token }}
- name: checkout cables
uses: actions/checkout@v4
with:
repository: "cables-gl/cables"
ref: ${{ inputs.branch }}
token: ${{ secrets.standalone_token }}
path: "cables/"
- name: checkout extensions
uses: actions/checkout@v4
with:
repository: "cables-gl/cables_extensionops"
ref: "main"
token: ${{ secrets.standalone_token }}
path: "cables/src/ops/extensions"
- name: checkout cables ui
uses: actions/checkout@v4
with:
repository: "cables-gl/cables_ui"
ref: ${{ inputs.branch }}
token: ${{ secrets.standalone_token }}
path: "cables_ui/"
- name: checkout cables electron
uses: actions/checkout@v4
with:
path: "cables_electron/"
ref: ${{ inputs.branch }}
- name: install nodejs
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
check-latest: false
- name: get node path
shell: bash
id: local_node
run: |
echo "NODE_EXE=$(which node)" >> $GITHUB_OUTPUT
echo "NPM_EXE=$(which npm)" >> $GITHUB_OUTPUT
- name: build electron
if: ${{ ! inputs.sign }}
shell: bash
run: ./hook_standalone.sh ${{ inputs.target }}
env:
EXE_NAME: ${{ inputs.exe_name }}
BUILD_VERSION: ${{ inputs.build_version }}
GH_TOKEN: ${{ secrets.github_token }}
NODE_EXE: ${{ steps.local_node.outputs.NODE_EXE }}
NPM_EXE: ${{ steps.local_node.outputs.NPM_EXE }}
RELEASE_TYPE: ${{ inputs.release_type }}
- name: build signed electron
if: ${{ inputs.sign }}
shell: bash
run: ./hook_standalone.sh ${{ inputs.target }}
env:
EXE_NAME: ${{ inputs.exe_name }}
BUILD_VERSION: ${{ inputs.build_version }}
GH_TOKEN: ${{ secrets.github_token }}
CSC_LINK: "${{ secrets.APPLE_CERT }}"
CSC_KEY_PASSWORD: "${{ secrets.APPLE_CERT_PASS }}"
APPLE_ID: "${{ secrets.APPLE_ID }}"
APPLE_APP_SPECIFIC_PASSWORD: "${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}"
APPLE_TEAM_ID: "${{ secrets.APPLE_TEAM_ID }}"
NOTARIZE: "${{ inputs.notarize }}"
NODE_EXE: ${{ steps.local_node.outputs.NODE_EXE }}
NPM_EXE: ${{ steps.local_node.outputs.NPM_EXE }}
RELEASE_TYPE: ${{ inputs.release_type }}
- name: delete update files
uses: mknejp/delete-release-assets@v1
continue-on-error: true
with:
token: ${{ github.token }}
tag: v${{ inputs.tag_name }}
fail-if-no-assets: false
fail-if-no-release: false
assets: |
*.yml
*.blockmap
v${{ inputs.tag_name }}.zip
v${{ inputs.tag_name }}.tar.gz