-
Notifications
You must be signed in to change notification settings - Fork 2
124 lines (105 loc) · 3.72 KB
/
package-main.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
name: Package
on:
push:
branches: [main]
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
publish:
name: Main on ${{ matrix.os }}, .Net ${{ matrix.dotnet_version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
dotnet_version: [8.0.x]
steps:
- name: Install MacPorts
if: ${{ matrix.os == 'macos-latest' }}
uses: melusina-org/setup-macports@v1
- name: Install icu4c on macOS
if: ${{ matrix.os == 'macos-latest' }}
run: |
sudo port -v install icu
- name: Checkout git repo
uses: actions/checkout@v4
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet_version }}
- name: Read package.json
id: package_json
uses: zoexx/[email protected]
with:
file_path: 'package.json'
- name: Install Node and NPM
uses: actions/setup-node@v4
with:
node-version: ${{ fromJson(steps.package_json.outputs.volta).node }}
cache: npm
- name: Install packages and build
run: |
npm ci
npm run build
- name: Update release version
shell: bash
run: |
COMMIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
cd ./release/app
CURRENT_VERSION=$(node -pe "require('./package.json').version")
NEW_VERSION="${CURRENT_VERSION}-commit.${COMMIT_HASH}"
echo "Updating version from ${CURRENT_VERSION} to ${NEW_VERSION}"
npm --no-git-tag-version version $NEW_VERSION
- name: Publish releases - Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
npm exec electron-builder -- build --publish never --win
- name: Publish releases - macOS
if: ${{ matrix.os == 'macos-latest' }}
# env:
# # These values are used for auto updates signing
# APPLE_ID: ${{ secrets.APPLE_ID }}
# APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
# CSC_LINK: ${{ secrets.CSC_LINK }}
# CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
run: |
npm exec electron-builder -- build --publish never --mac
- name: Publish releases - Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
env:
# no hardlinks so dependencies are copied
USE_HARD_LINKS: false
run: |
npm exec electron-builder -- build --publish never --linux
- name: Upload Windows artifacts
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/upload-artifact@v4
with:
name: app-windows
path: |
./release/build/*.exe
!./release/build/*Setup*.exe
- name: Upload macOS artifacts
if: ${{ matrix.os == 'macos-latest' }}
uses: actions/upload-artifact@v4
with:
name: app-macos
path: |
./release/build/*.dmg
- name: Upload Linux artifacts
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v4
with:
name: app-linux
path: |
./release/build/*.AppImage
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true