Skip to content

Commit 98df6ae

Browse files
Create windows.yml
1 parent 1ad2f1c commit 98df6ae

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

.github/workflows/windows.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Windows
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- '**'
8+
- 'examples/**'
9+
- '.github/workflows/windows.yml'
10+
pull_request:
11+
paths:
12+
- '**'
13+
- 'examples/**'
14+
- '.github/workflows/windows.yml'
15+
release:
16+
types: [published]
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
build:
23+
permissions:
24+
contents: write # for actions/upload-release-asset to upload release asset
25+
runs-on: windows-latest
26+
strategy:
27+
fail-fast: false
28+
max-parallel: 1
29+
matrix:
30+
compiler: [mingw-w64]
31+
bits: [64]
32+
33+
env:
34+
RELEASE_NAME: RGFW-Python-dev_win${{ matrix.bits }}_${{ matrix.compiler }}
35+
GNUTARGET: default
36+
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@master
40+
41+
- name: Setup Release Version
42+
run: |
43+
echo "RELEASE_NAME=RGFW-Python-${{ github.event.release.tag_name }}_win${{ matrix.bits }}_${{ matrix.compiler }}" >> $GITHUB_ENV
44+
shell: bash
45+
if: github.event_name == 'release' && github.event.action == 'published'
46+
47+
- name: Setup Environment
48+
run: |
49+
dir
50+
mkdir build
51+
cd build
52+
mkdir ${{ env.RELEASE_NAME }}
53+
cd ${{ env.RELEASE_NAME }}
54+
mkdir include
55+
mkdir lib
56+
cd ../../../RGFW-Python
57+
58+
- name: Build Library (MinGW-w64 64bit)
59+
run: |
60+
${{ matrix.ARCH }}-w64-mingw32-gcc.exe --version
61+
windres.exe --version
62+
dir C:\msys64\mingw64\bin
63+
make build-RGFW
64+
shell: cmd
65+
if: |
66+
matrix.compiler == 'mingw-w64' &&
67+
matrix.bits == 64
68+
69+
- name: Generate Artifacts
70+
run: |
71+
copy /Y .\RGFW.h .\build\${{ env.RELEASE_NAME }}\include
72+
copy /Y .\libRGFW.dll .\build\${{ env.RELEASE_NAME }}\lib
73+
copy /Y .\RGFW.py .\build\${{ env.RELEASE_NAME }}\lib
74+
copy /Y .\README.md .\build\${{ env.RELEASE_NAME }}\README.md
75+
cd build
76+
7z a ./${{ env.RELEASE_NAME }}.zip ./${{ env.RELEASE_NAME }}
77+
dir
78+
shell: cmd
79+
80+
- name: Upload Artifacts
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: ${{ env.RELEASE_NAME }}.zip
84+
path: ./build/${{ env.RELEASE_NAME }}.zip
85+
86+
- name: Upload Artifact to Release
87+
uses: softprops/action-gh-release@v1
88+
with:
89+
files: ./build/${{ env.RELEASE_NAME }}.zip
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
if: github.event_name == 'release' && github.event.action == 'published'

0 commit comments

Comments
 (0)