-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (99 loc) · 4.25 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
name: Build
permissions:
contents: write
env:
VS_VERSION: 2019
on:
workflow_dispatch:
inputs:
libcec_version:
description: LibCEC Version
required: true
jobs:
build:
strategy:
fail-fast: false
matrix:
flavor: [Release, Debug]
arch: [x86, amd64]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
repository: Pulse-Eight/libcec
ref: libcec-${{ github.event.inputs.libcec_version }}
submodules: recursive
- name: Install python 3.11.4 with debug binaries
if: ${{ matrix.flavor == 'Debug' }}
run: |
$arch = '${{ matrix.arch }}' -eq 'x86' ? "" : "-amd64"
curl -o python-3.11.4$arch.exe https://www.python.org/ftp/python/3.11.4/python-3.11.4$arch.exe
Start-Process -FilePath "python-3.11.4$arch.exe" -ArgumentList "/quiet Include_debug=1 PrependPath=1 InstallAllUsers=0" -Verb runas -Wait
- name: Setup developer command prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Create directories
run: |
mkdir -p ${{ github.workspace }}\build\${{matrix.arch}}_${{ matrix.flavor }}
mkdir -p ${{ github.workspace }}\dist\${{matrix.arch}}\${{ matrix.flavor }}
- name: Build and install platform library
working-directory: ${{ github.workspace }}/src/platform/windows
run: cmd /c build-lib.cmd ${{ matrix.arch }} ${{ matrix.flavor }} ${{ env.VS_VERSION }} ${{ github.workspace }}\build\${{matrix.arch}}_${{ matrix.flavor }}
- name: Build libcec
working-directory: ${{ github.workspace }}/windows
run: cmd /c build-lib.cmd ${{ matrix.arch }} ${{ matrix.flavor }} ${{ env.VS_VERSION }} ${{ github.workspace }}\build\${{matrix.arch}}_${{ matrix.flavor }} nmake
- name: Copy into dist folder
run: cp -r ${{ github.workspace }}\build\${{matrix.arch}}_${{ matrix.flavor }}\${{matrix.arch}}\* ${{ github.workspace }}\dist\${{matrix.arch}}\${{ matrix.flavor }}\
- uses: actions/upload-artifact@v3
with:
name: libcec_${{matrix.arch}}_${{ matrix.flavor }}
path: ${{ github.workspace }}\dist\${{matrix.arch}}\${{ matrix.flavor }}
commit:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Clean prebuilt folder
run: git rm -rf prebuilt/*
- name: Create folder structure
run: |
mkdir -p prebuilt/amd64/{debug,release}
mkdir -p prebuilt/x86/{debug,release}
- name: Copy artifact binaries
run: |
cp -r libcec_amd64_Release/* prebuilt/amd64/release/
cp -r libcec_amd64_Debug/* prebuilt/amd64/debug/
cp -r libcec_x86_Release/* prebuilt/x86/release/
cp -r libcec_x86_Debug/* prebuilt/x86/debug/
- name: List directory
run: find .
- name: Git commit back to repo
run: |
git config --global user.name "GH-Workflow"
git config --global user.email "[email protected]"
git add prebuilt
git commit -m "libcec ${{ github.event.inputs.libcec_version }} binaries"
git push origin HEAD:master
git tag -a ${{ github.event.inputs.libcec_version }} -m "Test tag"
git push origin ${{ github.event.inputs.libcec_version }}
upload_releases:
needs: [build,commit]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- name: Create bundles folder
run: mkdir bundles/
- name: Create zip bundle
run: |
zip -r bundles/libcec-${{ github.event.inputs.libcec_version }}_amd64_release.zip libcec_amd64_Release
zip -r bundles/libcec-${{ github.event.inputs.libcec_version }}_amd64_debug.zip libcec_amd64_Debug
zip -r bundles/libcec-${{ github.event.inputs.libcec_version }}_x86_release.zip libcec_x86_Release
zip -r bundles/libcec-${{ github.event.inputs.libcec_version }}_x86_debug.zip libcec_x86_Debug
- name: Upload Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.libcec_version }}
files: |
bundles/*