Skip to content

Commit 0617961

Browse files
committed
refine CI workflow
1 parent c30be89 commit 0617961

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
name: PyStand
22

3-
on: [ push, pull_request ]
3+
on:
4+
push:
5+
pull_request:
6+
types: [ opened, synchronize, reopened, ready_for_review ]
47

58
env:
6-
PYSTAND_VERSION: v1.0.6
79
BUILD_TYPE: Release
810

911
jobs:
1012
build-msvc:
1113
if: >-
12-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
1314
github.event.pull_request.draft == false
1415
1516
runs-on: windows-latest
1617

1718
strategy:
1819
fail-fast: false
1920
matrix:
21+
arch: [ Win32, x64 ]
22+
subsystem: [ GUI, CLI ]
2023
include:
21-
- { generator: Visual Studio 17 2022, arch: Win32, subsystem: GUI }
22-
- { generator: Visual Studio 17 2022, arch: Win32, subsystem: CLI }
23-
- { generator: Visual Studio 17 2022, arch: x64, subsystem: GUI }
24-
- { generator: Visual Studio 17 2022, arch: x64, subsystem: CLI }
24+
- generator: Visual Studio 17 2022
2525

2626
steps:
2727
- name: Checkout
@@ -42,32 +42,28 @@ jobs:
4242
- name: Upload artifacts
4343
uses: actions/upload-artifact@v3
4444
with:
45-
name: PyStand-${{ env.PYSTAND_VERSION }}-${{ matrix.arch }}-${{ matrix.subsystem }}
45+
name: PyStand-${{ matrix.arch }}-${{ matrix.subsystem }}
4646
path: build/${{ env.BUILD_TYPE }}
4747

4848
build-gcc:
4949
if: >-
50-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
5150
github.event.pull_request.draft == false
5251
5352
runs-on: windows-latest
5453

5554
strategy:
5655
fail-fast: false
5756
matrix:
58-
include:
59-
- { sys: mingw32, arch: i686, subsystem: GUI }
60-
- { sys: mingw32, arch: i686, subsystem: CLI }
61-
- { sys: mingw64, arch: x86_64, subsystem: GUI }
62-
- { sys: mingw64, arch: x86_64, subsystem: CLI }
57+
sys: [ mingw32, mingw64 ]
58+
subsystem: [ GUI, CLI ]
6359

6460
steps:
6561
- name: Checkout
6662
uses: actions/checkout@v3
6763

68-
- name: Setup MinGW-w64
64+
- name: Setup WinLibs
6965
run: |
70-
if ( '${{ matrix.arch }}' -eq 'i686' )
66+
if ( '${{ matrix.sys }}' -eq 'mingw32' )
7167
{
7268
Invoke-WebRequest -Uri https://github.com/brechtsanders/winlibs_mingw/releases/download/7.5.0-7.0.0-r1/winlibs-i686-posix-dwarf-gcc-7.5.0-mingw-w64-7.0.0-r1.7z -OutFile ${{ matrix.sys }}.7z
7369
}
@@ -93,14 +89,16 @@ jobs:
9389
- name: Upload artifacts
9490
uses: actions/upload-artifact@v3
9591
with:
96-
name: PyStand-${{ env.PYSTAND_VERSION }}-${{ matrix.sys }}-${{ matrix.subsystem }}
92+
name: PyStand-${{ matrix.sys }}-${{ matrix.subsystem }}
9793
path: build\PyStand.exe
9894

9995
release:
100-
needs: [ build-msvc, build-gcc ]
96+
if: startsWith(github.ref, 'refs/tags/')
10197

10298
runs-on: windows-latest
10399

100+
needs: [ build-msvc, build-gcc ]
101+
104102
steps:
105103
- name: Download artifacts
106104
uses: actions/download-artifact@v3
@@ -109,19 +107,21 @@ jobs:
109107
run: ls -R
110108

111109
- name: Create archives
112-
run: |
113-
7z a PyStand-${{ env.PYSTAND_VERSION }}-Win32-CLI.zip .\PyStand-${{ env.PYSTAND_VERSION }}-Win32-CLI\*
114-
7z a PyStand-${{ env.PYSTAND_VERSION }}-Win32-GUI.zip .\PyStand-${{ env.PYSTAND_VERSION }}-Win32-GUI\*
115-
7z a PyStand-${{ env.PYSTAND_VERSION }}-x64-CLI.zip .\PyStand-${{ env.PYSTAND_VERSION }}-x64-CLI\*
116-
7z a PyStand-${{ env.PYSTAND_VERSION }}-x64-GUI.zip .\PyStand-${{ env.PYSTAND_VERSION }}-x64-GUI\*
117-
7z a PyStand-${{ env.PYSTAND_VERSION }}-mingw32-CLI.zip .\PyStand-${{ env.PYSTAND_VERSION }}-mingw32-CLI\*
118-
7z a PyStand-${{ env.PYSTAND_VERSION }}-mingw32-GUI.zip .\PyStand-${{ env.PYSTAND_VERSION }}-mingw32-GUI\*
119-
7z a PyStand-${{ env.PYSTAND_VERSION }}-mingw64-CLI.zip .\PyStand-${{ env.PYSTAND_VERSION }}-mingw64-CLI\*
120-
7z a PyStand-${{ env.PYSTAND_VERSION }}-mingw64-GUI.zip .\PyStand-${{ env.PYSTAND_VERSION }}-mingw64-GUI\*
110+
run: >
111+
7z
112+
a
113+
PyStand-v${{ github.ref_name }}-exe.zip
114+
PyStand-Win32-CLI
115+
PyStand-Win32-GUI
116+
PyStand-x64-CLI
117+
PyStand-x64-GUI
118+
PyStand-mingw32-CLI
119+
PyStand-mingw32-GUI
120+
PyStand-mingw64-CLI
121+
PyStand-mingw64-GUI
121122
122123
- name: Release
123124
uses: softprops/action-gh-release@v1
124-
if: startsWith(github.ref, 'refs/tags/')
125125
env:
126126
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
127127
with:

0 commit comments

Comments
 (0)