-
Notifications
You must be signed in to change notification settings - Fork 67
147 lines (118 loc) · 4.55 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
name: CI
on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
release:
types:
- published
pull_request:
paths-ignore:
- 'docs/**'
jobs:
build:
runs-on: windows-latest
env:
VERSION: ${{github.event.release.tag_name}}
steps:
- uses: actions/checkout@v4
- uses: falti/[email protected]
id: dotenv
- name: Download/Unpack MSYS
shell: bash
run: |
curl -L -O ${{ steps.dotenv.outputs.msys_url }}
tar -xvf msys2-base-x86_64-*.tar.xz --one-top-level=.build
- name: Download/Unpack ConEmu
shell: bash
run: |
curl -L -O ${{ steps.dotenv.outputs.conemu_url }}
7z x ConEmuPack.*.7z -o.build/msys64/conemu/
- name: Download Driver Installer
shell: bash
run: |
mkdir .build/drivers/
curl -L --output-dir .build/drivers/ -O https://raw.githubusercontent.com/qmk/qmk_firmware/master/util/drivers.txt
curl -L --output-dir .build/drivers/ -O https://github.com/qmk/qmk_driver_installer/releases/download/v1.01/qmk_driver_installer.exe
- name: Update MSYS
run: |
.build\msys64\msys2_shell.cmd -mingw64 -defterm -no-start -c "pacman -Syu --noconfirm || true"
.build\msys64\msys2_shell.cmd -mingw64 -defterm -no-start -c "pacman -Syu --noconfirm"
.build\msys64\msys2_shell.cmd -mingw64 -defterm -no-start -c "pacman -Su --noconfirm"
- name: Install QMK cli
run: |
.build\msys64\msys2_shell.cmd -mingw64 -defterm -no-start -c "pacman --needed --noconfirm --disable-download-timeout -S pactoys"
.build\msys64\msys2_shell.cmd -mingw64 -defterm -no-start -c "pacboy sync --needed --noconfirm --disable-download-timeout base-devel: toolchain:x clang:x git: jq:x python-qmk:x hidapi:x avr-binutils:x avr-gcc:x avr-libc:x arm-none-eabi-binutils:x arm-none-eabi-gcc:x arm-none-eabi-newlib:x avrdude:x bootloadhid:x dfu-programmer:x dfu-util:x hid-bootloader-cli:x mdloader:x teensy-loader-cli:x wb32-dfu-updater:x"
.build\msys64\msys2_shell.cmd -mingw64 -defterm -no-start -c "qmk"
- name: Test QMK cli version
run: |
.build\msys64\msys2_shell.cmd -mingw64 -defterm -no-start -c "qmk --version | grep -F ${{ steps.dotenv.outputs.qmk_cli_ver }}"
- name: Patch Up MSYS
shell: 'bash {0}'
run: |
rm -rf .build/msys64/home/*
rm -rf .build/msys64/dev/*
rm -rf .build/msys64/etc/mtab
rm -rf .build/msys64/etc/hosts
rm -rf .build/msys64/var/cache/pacman/pkg/*
rm -f .build/msys64/*.exe
rm -f .build/msys64/*.ico
rm -f .build/msys64/msys2_shell.cmd
mkdir -p .build/msys64/dev/shm
mkdir -p .build/msys64/dev/mqueue
cp -rf src/* .build/msys64/
echo "VERSION_ID=$GITHUB_SHA" >> .build/msys64/etc/qmk-release
echo "VERSION=${VERSION:-2.0.0}" >> .build/msys64/etc/qmk-release
- name: Create Installer
shell: 'bash {0}'
run: |
iscc installer/install.iss //DMyAppVersion=${VERSION:-2.0.0}
sha256sum .build/QMK_MSYS.exe > .build/QMK_MSYS.exe.sha256
- uses: actions/upload-artifact@v4
with:
name: artifacts
path: .build/QMK_MSYS.*
include-hidden-files: true
test:
runs-on: windows-latest
needs: [build]
steps:
- uses: actions/download-artifact@v4
- name: Run Install
run: |
Start-Process ./artifacts/QMK_MSYS.exe -ArgumentList "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /DIR=expand:{autopf}\QMK_MSYS" -wait
- name: Run QMK cli
env:
MSYSTEM: MINGW64
shell: cmd
run: |
"%ProgramFiles%\QMK_MSYS\usr\bin\bash.exe" -l -c 'qmk -h' | findstr /c:"CLI wrapper for running QMK commands"
publish_release:
runs-on: ubuntu-latest
needs: [test]
if: github.event.release.tag_name
steps:
- uses: actions/download-artifact@v4
- uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ github.event.release.name }}
files: |
./artifacts/QMK_MSYS.*
publish_beta:
runs-on: ubuntu-latest
needs: [test]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- uses: actions/download-artifact@v4
- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "beta"
prerelease: true
title: "Latest Beta"
files: |
./artifacts/QMK_MSYS.*