Skip to content

Commit bd89e02

Browse files
authored
Merge pull request #94 from glowinthedark/patch-2
add optional dialog and step to release artifacts
2 parents 54ec1a8 + 0cc0753 commit bd89e02

File tree

1 file changed

+43
-5
lines changed

1 file changed

+43
-5
lines changed

.github/workflows/build-windows.yml

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
name: Build wheels for Windows x64
1+
name: Build/release wheels for Windows x64
22

33
on:
44
workflow_dispatch:
5-
5+
inputs:
6+
custom_ref:
7+
description: 'custom ref/tag'
8+
required: false
9+
do_release:
10+
description: 'Creating release from artifacts: type "y" to enable'
11+
required: false
612
jobs:
713
build-w64:
814
runs-on:
@@ -27,7 +33,7 @@ jobs:
2733
cd build
2834
cmake ..
2935
- name: Add msbuild to PATH
30-
uses: microsoft/setup-msbuild@v1.1
36+
uses: microsoft/setup-msbuild@v2
3137
# with:
3238
# msbuild-architecture: x64
3339
- name: Build lzo static lib
@@ -48,7 +54,39 @@ jobs:
4854
- name: Upload artifact
4955
uses: actions/upload-artifact@v4
5056
with:
51-
name: wheels
52-
path: dist
57+
name: ${{ github.event.repository.name }}-py${{ matrix.python-version }}
58+
path: dist\*.whl
5359
overwrite: true
5460
if-no-files-found: error
61+
62+
release:
63+
if: ${{ github.event.inputs.do_release == 'y' && github.event.inputs.custom_ref != '' }}
64+
needs: [build-w64]
65+
runs-on: ubuntu-latest
66+
permissions:
67+
contents: write
68+
69+
env:
70+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
72+
steps:
73+
- name: Download artifacts
74+
uses: actions/download-artifact@v4
75+
with:
76+
path: ./artifacts
77+
merge-multiple: true
78+
79+
- name: List all files
80+
run: ls -R ./artifacts
81+
82+
- name: do release
83+
run: |
84+
gh release create '${{ github.event.inputs.custom_ref}}' \
85+
-t '${{ github.event.inputs.custom_ref}}' \
86+
--title "${{ github.event.repository.name }}-${{ github.event.inputs.custom_ref}}" \
87+
--target '${{ github.ref_name }}' \
88+
--latest=true \
89+
--generate-notes \
90+
--repo ${GITHUB_REPOSITORY}
91+
gh release upload '${{ github.event.inputs.custom_ref}}' --repo ${GITHUB_REPOSITORY} --clobber \
92+
./artifacts/*

0 commit comments

Comments
 (0)