Skip to content

Commit 1c8f32f

Browse files
committed
fixup! wip: windows-release
1 parent 45c0933 commit 1c8f32f

3 files changed

Lines changed: 93 additions & 34 deletions

File tree

.github/workflows/archive.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
$ErrorActionPreference = "Stop"
2+
3+
$env:PATH = "C:\php\devel;C:\php\bin;C:\php\deps\bin;$env:PATH"
4+
5+
Copy-Item "php_$env:PHP_EXT.dll" "php_$env:PHP_EXT-$env:PHP_EXT_VERSION--$env:PHP_VER-$env::TS-$env::VS-$env:ARCH.dll"
6+
7+
Compress-Archive -Path "php_$env:PHP_EXT-$env:PHP_EXT_VERSION--$env:PHP_VER-$env::TS-$env::VS-$env:ARCH.dll" -Destination "php_$env:PHP_EXT-$env:PHP_EXT_VERSION--$env:PHP_VER-$env::TS-$env::VS-$env:ARCH.zip"

.github/workflows/windows-release.yml

Lines changed: 79 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,97 @@ on:
77

88
permissions: {}
99

10+
env:
11+
PHP_EXT: snappy
12+
BIN_SDK_VER: 2.3.0
13+
1014
jobs:
11-
get-extension-matrix:
12-
runs-on: ubuntu-latest
13-
outputs:
14-
matrix: ${{ steps.extension-matrix.outputs.matrix }}
15-
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v4
18-
with:
19-
persist-credentials: false
20-
- id: extension-matrix
21-
name: Get the extension matrix
22-
uses: php/php-windows-builder/extension-matrix@v1
2315
build:
24-
needs: get-extension-matrix
25-
runs-on: ${{ matrix.os }}
16+
runs-on: ${{ matrix.vs == 'vs17' && 'windows-2022' || 'windows-2019' }}
17+
env:
18+
# PHP_EXT_VERSION: ${{ github.event.release.tag_name }}
19+
PHP_EXT_VERSION: 0.2.3 # WIP
20+
PHP_VER: ${{ matrix.php }}
21+
VS: ${{ matrix.vs }}
22+
ARCH: ${{ matrix.arch }}
23+
TS: ${{ matrix.ts }}
2624
steps:
27-
- name: Checkout
25+
- name: Checkout repository
2826
uses: actions/checkout@v4
2927
with:
3028
persist-credentials: false
31-
submodules: true
32-
- name: Build the extension
33-
uses: php/php-windows-builder/extension@v1
29+
- name: Checkout submodule
30+
run: .\.github\workflows\submodule.ps1
31+
shell: powershell
32+
- name: Install build command
33+
run: .\.github\workflows\install.ps1
34+
shell: powershell
35+
- name: Build
36+
run: .\.github\workflows\build.ps1
37+
shell: powershell
38+
- name: Test
39+
run: .\.github\workflows\test.ps1
40+
shell: powershell
41+
env:
42+
REPORT_EXIT_STATUS: 1
43+
NO_INTERACTION: 1
44+
- name: Archive
45+
run: .\.github\workflows\archive.ps1
46+
shell: powershell
47+
- name: Store artifact DLL
48+
uses: actions/upload-artifact@v4
3449
with:
35-
php-version: ${{ matrix.php-version }}
36-
arch: ${{ matrix.arch }}
37-
ts: ${{ matrix.ts }}
50+
name: php_${{ env.PHP_EXT }}-${{ env.PHP_EXT_VERSION }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.vs }}-${{ matrix.arch }}
51+
path: .\php_${{ env.PHP_EXT }}-${{ env.PHP_EXT_VERSION }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.vs }}-${{ matrix.arch }}.zip
52+
overwrite: true
3853
strategy:
39-
matrix: ${{fromJson(needs.get-extension-matrix.outputs.matrix)}}
54+
matrix:
55+
php:
56+
- '8.4'
57+
- '8.3'
58+
- '8.2'
59+
- '8.1'
60+
arch:
61+
- x64
62+
- x86
63+
ts:
64+
- 'nts'
65+
- 'ts'
66+
vs:
67+
- vs16
68+
- vs17
69+
exclude:
70+
- php: '8.4'
71+
vs: vs16
72+
- php: '8.3'
73+
vs: vs17
74+
- php: '8.2'
75+
vs: vs17
76+
- php: '8.1'
77+
vs: vs17
78+
4079
release:
4180
permissions:
4281
contents: write
4382
needs: build
44-
if: ${{ github.event_name == 'release' }}
4583
runs-on: ubuntu-latest
84+
env:
85+
# PHP_EXT_VERSION: ${{ github.event.release.tag_name }}
86+
PHP_EXT_VERSION: 0.2.3 # WIP
87+
# if: ${{ github.event_name == 'release' }}
4688
steps:
47-
- name: Upload artifact to the release
48-
uses: php/php-windows-builder/release@v1
89+
- name: Checkout
90+
uses: actions/checkout@v4
91+
with:
92+
persist-credentials: false
93+
- name: Get artifacts
94+
uses: actions/download-artifact@v4
4995
with:
50-
release: ${{ github.event.release.tag_name }}
51-
token: ${{ secrets.GITHUB_TOKEN }}
96+
path: artifacts
97+
merge-multiple: true
98+
- name: Upload artifacts
99+
# env:
100+
# GITHUB_TOKEN: ${{ inputs.token }}
101+
# run: gh release upload ${{ github.event.release.tag_name }} artifacts/php* --clobber
102+
run: gh release upload ${{ env.PHP_EXT_VERSION }} artifacts/php* --clobber
103+
shell: bash

.github/workflows/windows.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ jobs:
7070
REPORT_EXIT_STATUS: 1
7171
NO_INTERACTION: 1
7272

73-
- name: Store artifact DLL
74-
uses: actions/upload-artifact@v4
75-
with:
76-
name: php_${{ env.PHP_EXT }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.vs }}-${{ matrix.arch }}
77-
path: .\php_${{ env.PHP_EXT }}.dll
78-
overwrite: true
79-
if: ${{ matrix.library == '' }}
73+
# - name: Store artifact DLL
74+
# uses: actions/upload-artifact@v4
75+
# with:
76+
# name: php_${{ env.PHP_EXT }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.vs }}-${{ matrix.arch }}
77+
# path: .\php_${{ env.PHP_EXT }}.dll
78+
# overwrite: true
79+
# if: ${{ matrix.library == '' }}

0 commit comments

Comments
 (0)