1
1
name : Windows
2
2
3
- on : [push]
3
+ on :
4
+ push :
5
+ release :
6
+ types : [published]
4
7
5
8
env :
6
9
PHP_EXT : brotli
10
+ PHP_EXT_VERSION : ${{ github.event.release.tag_name }}
7
11
BIN_SDK_VER : 2.3.0
8
12
9
-
10
13
jobs :
11
14
ci :
12
15
strategy :
@@ -51,12 +54,16 @@ jobs:
51
54
steps :
52
55
- name : Checkout repository
53
56
uses : actions/checkout@v4
57
+ with :
58
+ persist-credentials : false
54
59
55
60
- name : Checkout submodule
56
61
run : .\.github\workflows\submodule.ps1
62
+ shell : pwsh
57
63
if : ${{ ! matrix.library }}
58
64
- name : Install dependency library
59
65
run : .\.github\workflows\vcpkg.ps1
66
+ shell : pwsh
60
67
env :
61
68
VCPKG_LIBRARY : brotli
62
69
if : ${{ matrix.library }}
@@ -69,20 +76,59 @@ jobs:
69
76
70
77
- name : Install build command
71
78
run : .\.github\workflows\install.ps1
79
+ shell : pwsh
72
80
73
81
- name : Build
74
82
run : .\.github\workflows\build.ps1
83
+ shell : pwsh
75
84
76
85
- name : Test
77
86
run : .\.github\workflows\test.ps1
87
+ shell : pwsh
78
88
env :
79
89
REPORT_EXIT_STATUS : 1
80
90
NO_INTERACTION : 1
81
91
82
- - name : Store artifact DLL
92
+ - if : ${{ github.event_name == 'release' }}
93
+ name : Archive DLL
94
+ run : |-
95
+ Copy-Item .\php_${{ env.PHP_EXT }}.dll .\$env:EXT_NAME.dll
96
+ Compress-Archive -Path .\$env:EXT_NAME.dll -Destination .\$env:EXT_NAME.zip
97
+ shell : pwsh
98
+ env :
99
+ EXT_NAME : php_${{ env.PHP_EXT }}-${{ env.PHP_EXT_VERSION }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.vs }}-${{ matrix.arch }}
100
+
101
+ - if : ${{ github.event_name == 'release' }}
102
+ name : Store archive DLL
83
103
uses : actions/upload-artifact@v4
84
104
with :
85
- name : php_ ${{ env.PHP_EXT }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.vs }}-${{ matrix.arch }}
86
- path : .\php_${{ env.PHP_EXT }}.dll
105
+ name : ${{ env.PHP_EXT_VERSION }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.vs }}-${{ matrix.arch }}
106
+ path : .\php_${{ env.PHP_EXT }}-${{ env.PHP_EXT_VERSION }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.vs }}-${{ matrix.arch }}.zip
87
107
overwrite : true
88
- if : ${{ ! matrix.library }}
108
+
109
+ release :
110
+ permissions :
111
+ contents : write
112
+ needs : ci
113
+
114
+ runs-on : ubuntu-latest
115
+
116
+ if : ${{ github.event_name == 'release' }}
117
+
118
+ steps :
119
+ - name : Checkout
120
+ uses : actions/checkout@v4
121
+ with :
122
+ persist-credentials : false
123
+
124
+ - name : Get artifacts
125
+ uses : actions/download-artifact@v4
126
+ with :
127
+ path : artifacts
128
+ merge-multiple : true
129
+
130
+ - name : Upload artifacts
131
+ run : gh release upload ${{ env.PHP_EXT_VERSION }} artifacts/php* --clobber
132
+ shell : bash
133
+ env :
134
+ GH_TOKEN : ${{ github.token }}
0 commit comments