-
Notifications
You must be signed in to change notification settings - Fork 275
149 lines (134 loc) · 4.44 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Build
on:
# Build on new commits or pull requests.
push:
paths-ignore:
- '**.md'
pull_request:
schedule:
# Run every week just to make sure the CI environment still works.
- cron: '0 0 * * 0'
env:
DOTNET_VERSION: 8.0.x
jobs:
build-ubuntu:
runs-on: ubuntu-22.04
# Test building with .NET 7 and .NET 8
strategy:
matrix:
dotnet_version: [7.0.x, 8.0.x]
env:
# Skip pkg-config version checks. Ubuntu 22.04 doesn't have a recent
# enough version of the libraries for some symbols needed at runtime,
# but this doesn't matter for building.
ADW_1_CFLAGS: undefined
ADW_1_LIBS: undefined
GTK_CFLAGS: undefined
GTK_LIBS: undefined
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{matrix.dotnet_version}}
- name: Create temporary global.json
if: matrix.dotnet_version == '7.0.x'
run: mv .github/workflows/dotnet7.global.json ./global.json
- name: Install Apt Dependencies
run: |
sudo apt update
sudo apt install autotools-dev autoconf-archive gettext intltool libadwaita-1-dev
- name: Generate Tarball
run: |
./autogen.sh
make dist
- name: Build
run: |
./autogen.sh --prefix ${{ runner.temp }}
make build
- name: Test
run: make test
- name: Verify code formatting
# Ignore warning CA1416 for unavailable platform-specific code, since this is unrelated to formatting.
run: dotnet format --no-restore --verify-no-changes --exclude-diagnostics CA1416
- name: Test Install
run: make install
- name: Build Installer
run: make releasezip
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: Pinta-linux-dotnet-${{matrix.dotnet_version}}.zip
path: pinta-2.2.zip
if-no-files-found: error
build-macos:
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.DOTNET_VERSION}}
- name: Install Dependencies
run: brew install libadwaita adwaita-icon-theme gettext
- name: Build
run: dotnet build Pinta.sln -c Release
- name: Test
run: dotnet test Pinta.sln -c Release
- name: Add Cert to Keychain
if: github.event_name != 'pull_request'
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.MAC_CERTS_BASE64 }}
p12-password: ${{ secrets.MAC_CERTS_PASSWORD }}
- name: Build Installer
if: github.event_name != 'pull_request'
env:
MAC_DEV_PASSWORD: ${{ secrets.MAC_DEV_PASSWORD }}
run: |
cd installer/macos
./build_installer.sh
- name: Upload Installer
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: "Pinta.dmg"
path: installer/macos/Pinta.dmg
if-no-files-found: error
build-windows:
runs-on: windows-2022
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: microsoft/[email protected]
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.DOTNET_VERSION}}
- name: Install dependencies
uses: msys2/setup-msys2@v2
with:
path-type: inherit # Inherit the path so that dotnet can be found
update: true
install: mingw-w64-x86_64-libadwaita
- name: Build
run: dotnet build Pinta.sln -c Release -p:MinGWFolder=${MINGW_PREFIX}
- name: Test
run: dotnet test Pinta.sln -c Release -p:MinGWFolder=${MINGW_PREFIX}
# Note that msgfmt is already available from the Git for Windows installation!
- name: Build Installer
run: |
choco install innosetup -y -v
dotnet publish Pinta.sln -p:BuildTranslations=true -p:MinGWFolder=${MINGW_PREFIX} -c Release -r win-x64 --self-contained true -p:PublishDir=../release/bin
cp -r release/bin/icons release/bin/locale release/share/
rm -rf release/bin/icons release/bin/locale
cp installer/macos/hicolor.index.theme release/share/icons/hicolor/index.theme
iscc installer/windows/installer.iss
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: "Pinta.exe"
path: installer/windows/Pinta.exe
if-no-files-found: error