-
Notifications
You must be signed in to change notification settings - Fork 0
188 lines (171 loc) · 6.07 KB
/
Copy pathbuild.yml
File metadata and controls
188 lines (171 loc) · 6.07 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Build/release
on:
push:
branches:
- main
#on: workflow_dispatch
jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Get package.json version
id: get_version
shell: bash
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
- name: Create an empty release
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Releasing version $PACKAGE_VERSION"
gh release create "v$PACKAGE_VERSION" --draft \
--title "v$PACKAGE_VERSION" \
--notes-file RELEASE.md
# --notes "Pinokio version $PACKAGE_VERSION."
# windows:
# needs: "create-release"
# runs-on: windows-latest
# permissions:
# contents: write
# steps:
# - name: Check out Git repository
# uses: actions/checkout@v1
#
# - name: Install Node.js, NPM and Yarn
# uses: actions/setup-node@v1
# with:
# node-version: 22
#
# - name: Build/release Electron app
# id: electron-builder
# uses: samuelmeuli/action-electron-builder@v1.6.0
# with:
# github_token: ${{ secrets.github_token }}
#
# # If the commit is tagged with a version (e.g. "v1.0.0"),
# # release the app after building
# #release: ${{ startsWith(github.ref, 'refs/tags/v') }}
# #release: true
# release: false
# args: --win --dir # Build win-unpacked only
#
# - name: upload-unsigned-artifact
# id: upload-unsigned-artifact
# uses: actions/upload-artifact@v4
# with:
# #path: dist-win32
# path: dist-win32/win-unpacked/Pinokio.exe
# retention-days: 1
#
# - id: Sign
# if: ${{ runner.os == 'Windows' }}
# uses: signpath/github-action-submit-signing-request@v1.1
# with:
# api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
# organization-id: 'd2da0df2-dc12-4516-8222-87178d5ebf3d'
# project-slug: 'pinokio'
# signing-policy-slug: 'test-signing'
# github-artifact-id: '${{ steps.upload-unsigned-artifact.outputs.artifact-id }}'
# wait-for-completion: true
# output-artifact-directory: './signed-windows'
# parameters: |
# version: ${{ toJSON(github.ref_name) }}
#
# # Replace the unsigned exe with the signed exe
# - name: Replace with signed exe
# run: |
# copy /Y ".\signed-windows\Pinokio.exe" ".\dist\win-unpacked\Pinokio.exe"
#
# # Build the final installer from the signed exe
# - name: Build final installer
# run: |
# yarn run electron-builder --win --prepackaged dist/win-unpacked
#
#
# - name: Get package.json version
# id: get_version
# shell: bash
# run: |
# PACKAGE_VERSION=$(node -p "require('./package.json').version")
# echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
#
# - name: Publish GitHub Release with gh
# shell: bash
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# echo "Releasing version $PACKAGE_VERSION"
# #gh release create "v$PACKAGE_VERSION" ./signed-windows/*.exe \
# gh release create "v$PACKAGE_VERSION" ./dist/*.exe \
# --title "Release v$PACKAGE_VERSION" \
# --notes "Pinokio version $PACKAGE_VERSION."
mac:
needs: "create-release"
runs-on: macos-latest
permissions:
contents: write
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 22
# - name: Prepare for app notarization
# if: startsWith(matrix.os, 'macos')
# # Import Apple API key for app notarization on macOS
# run: |
# mkdir -p ~/private_keys/
# echo '${{ secrets.api_key }}' > ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8
- name: Build/release Electron app
id: electron-builder
uses: samuelmeuli/action-electron-builder@v1.6.0
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
#release: ${{ startsWith(github.ref, 'refs/tags/v') }}
release: true
mac_certs: ${{ secrets.mac_certs }}
mac_certs_password: ${{ secrets.mac_certs_password }}
env:
# macOS notarization API key
#API_KEY_ID: ${{ secrets.api_key_id }}
#API_KEY_ISSUER_ID: ${{ secrets.api_key_issuer_id }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- name: Show notarization-error.log
if: failure()
run: cat dist-darwin/**/notarization-error.log || echo "No notarization-error.log found"
linux:
needs: "create-release"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 22
- name: Build/release Electron app
id: electron-builder
uses: samuelmeuli/action-electron-builder@v1.6.0
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
#release: ${{ startsWith(github.ref, 'refs/tags/v') }}
release: true