-
Notifications
You must be signed in to change notification settings - Fork 5
99 lines (87 loc) · 2.64 KB
/
windows.yml
File metadata and controls
99 lines (87 loc) · 2.64 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
name: Windows Build
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- .github/workflows/docker.yml
- .github/workflows/linux.yml
- .github/workflows/macos.yml
pull_request:
branches:
- main
paths-ignore:
- .github/workflows/docker.yml
- .github/workflows/linux.yml
- .github/workflows/macos.yml
jobs:
build:
runs-on: ubuntu-latest
name: build (${{ matrix.config.name }})
strategy:
# needs to be set; reduce if github is cancelling jobs
max-parallel: 2
matrix:
config:
- name: "portable"
container: "ghcr.io/scrubbbbs/mxe:latest"
submodules: false
deps: ""
cmake_flags: ""
env: ""
container:
image: ${{ matrix.config.container }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Allow unsafe git in container
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Checkout submodules
if: matrix.config.submodules
run: |
git submodule init
git submodule update
#- name: Install build dependencies
# run: |
# sudo apt-get update
- name: Configure
shell: bash
run: |
shopt -s expand_aliases
source /build/mxe.env
${{ matrix.config.env }} qmake
- name: Build
shell: bash
run: |
shopt -s expand_aliases
source /build/mxe.env
${{ matrix.config.env }} make -j$(nproc)
- name: Get Build Info
shell: bash
id: get_version
run: |
ARCH="x86_64"
OS=windows
SHA=$(git rev-parse --short ${{ github.event.pull_request.head.sha || github.sha }})
VERSION=$(cat _win32/git.h | grep CBIRD_VERSION | sed 's/[^0-9\.]*//g')
echo "BUILD=${VERSION}-${SHA}-${OS}-${ARCH}" >> $GITHUB_OUTPUT
- name: Build Portable App
shell: bash
run: |
shopt -s expand_aliases
source /build/mxe.env # TODO: =>build.env after rebuilding docker image
export HOME="$PWD/home"
export WINEPREFIX="$PWD/wineprefix"
mkdir -p "$HOME" "$WINEPREFIX"
make install
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: "cbird-${{ steps.get_version.outputs.BUILD }}-${{ matrix.config.name }}"
path: _win32/cbird-win
retention-days: 30