Skip to content

Commit 1729950

Browse files
committed
ci: add windows workflow
1 parent 4c40864 commit 1729950

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

.github/workflows/windows.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Windows Build
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- .github/workflows/docker.yml
9+
pull_request:
10+
branches:
11+
- main
12+
paths-ignore:
13+
- .github/workflows/docker.yml
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
name: build (${{ matrix.config.name }})
19+
strategy:
20+
# needs to be set; reduce if github is cancelling jobs
21+
max-parallel: 2
22+
matrix:
23+
config:
24+
- name: "windows-portable"
25+
container: "ghcr.io/scrubbbbs/mxe:latest"
26+
submodules: false
27+
deps: ""
28+
cmake_flags: ""
29+
env: ""
30+
31+
container:
32+
image: ${{ matrix.config.container }}
33+
credentials:
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
ref: ${{ github.event.pull_request.head.sha }}
41+
42+
- name: Allow unsafe git in container
43+
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
44+
45+
- name: Checkout submodules
46+
if: matrix.config.submodules
47+
run: |
48+
git submodule init
49+
git submodule update
50+
51+
#- name: Install build dependencies
52+
# run: |
53+
# sudo apt-get update
54+
55+
- name: Configure
56+
shell: bash
57+
run: |
58+
shopt -s expand_aliases
59+
source /build/mxe.env
60+
${{ matrix.config.env }} qmake
61+
62+
- name: Build
63+
shell: bash
64+
run: |
65+
shopt -s expand_aliases
66+
source /build/mxe.env
67+
${{ matrix.config.env }} make -j$(nproc)
68+
69+
- name: Get Build Info
70+
shell: bash
71+
id: get_version
72+
run: |
73+
ARCH="x86_64"
74+
OS=windows
75+
SHA=$(git rev-parse --short ${{ github.event.pull_request.head.sha || github.sha }})
76+
VERSION=$(cat _win32/git.h | grep CBIRD_VERSION | sed 's/[^0-9\.]*//g')
77+
echo "BUILD=${VERSION}-${SHA}-${OS}-${ARCH}" >> $GITHUB_OUTPUT
78+
79+
- name: Build Portable App
80+
shell: bash
81+
run: |
82+
shopt -s expand_aliases
83+
source /build/mxe.env
84+
export HOME="$PWD/home"
85+
export WINEPREFIX="$PWD/wineprefix"
86+
mkdir -p "$HOME" "$WINEPREFIX"
87+
make install
88+
89+
- name: Upload Artifacts
90+
uses: actions/upload-artifact@v4
91+
with:
92+
name: "cbird-${{ steps.get_version.outputs.BUILD }}-${{ matrix.config.name }}"
93+
path: _win32/cbird-win
94+
retention-days: 30
95+

0 commit comments

Comments
 (0)