-
Notifications
You must be signed in to change notification settings - Fork 29
142 lines (118 loc) · 3.81 KB
/
ci.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
name: 'Continuous integration'
on:
workflow_dispatch:
inputs:
publish_release:
description: If this build should publish nuget packages
required: true
type: boolean
version_suffix:
description: Suffix of the version number. Can be used to create a preview package.
required: false
type: string
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
env:
configuration: Release
publish_release: ${{ github.event.inputs.publish_release }}
version_suffix: ${{ github.event.inputs.version_suffix }}
jobs:
build_macos:
name: Build (MacOS)
runs-on: macos-12
if: github.event.inputs.publish_release != 'true'
defaults:
run:
shell: bash
steps:
- name: Install dependencies
run: brew install cairo gdk-pixbuf gobject-introspection meson
- name: Prepare git
run: git config --global core.autocrlf false
shell: bash
- name: Checkout with submodules
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Create Gir.Core
uses: ./.github/actions/create
with:
configuration: ${{ env.configuration }}
source_directory: './src'
shell: bash
build_windows:
name: Build (Windows)
runs-on: windows-latest
if: github.event.inputs.publish_release != 'true'
defaults:
run:
shell: msys2 {0}
steps:
- 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-cairo
mingw-w64-x86_64-gcc
mingw-w64-x86_64-gdk-pixbuf2
mingw-w64-x86_64-gobject-introspection
mingw-w64-x86_64-meson
- name: Prepare git
run: git config --global core.autocrlf false
shell: bash
- name: Checkout with submodules
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Create Gir.Core
uses: ./.github/actions/create
with:
configuration: ${{ env.configuration }}
source_directory: './src'
shell: msys2 {0}
build_linux:
name: Build (Linux)
runs-on: ubuntu-latest
container:
image: fedora:latest
env:
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
defaults:
run:
shell: bash
steps:
- name: Install dependencies
run: sudo dnf -y upgrade && sudo dnf -y install meson gobject-introspection-devel git gcc glib2-devel gdk-pixbuf2 gdk-pixbuf2-modules cairo-gobject
- name: Prepare git
run: git config --global core.autocrlf false
shell: bash
- name: Checkout with submodules
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Create Gir.Core
uses: ./.github/actions/create
with:
configuration: ${{ env.configuration }}
source_directory: './src'
shell: bash
- name: Verify code format
run: dotnet format GirCore.sln --no-restore --verify-no-changes --exclude *.Generated.cs
working-directory: './src'
- name: Run integration tests
run: dotnet test --no-restore -c $configuration --filter TestCategory=IntegrationTest
working-directory: './src'
- name: Pack release version
if: env.publish_release == 'true'
run: dotnet pack --no-build --nologo -c $configuration --version-suffix "$version_suffix" -o ../Nuget
working-directory: './src'
- name: Publish to nuget org
if: env.publish_release == 'true'
run: dotnet nuget push "*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s nuget.org
working-directory: './Nuget'