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