Commit 33c615e 1 parent e5ab1ad commit 33c615e Copy full SHA for 33c615e
File tree 2 files changed +74
-8
lines changed
2 files changed +74
-8
lines changed Original file line number Diff line number Diff line change 1
1
name : Build and Publish PHP Extension
2
2
3
3
on :
4
- push :
5
- tags :
6
- - turso-php-extension-v*.*.*
4
+ release :
5
+ types : [created]
7
6
8
7
permissions :
9
8
contents : write
@@ -16,13 +15,30 @@ jobs:
16
15
strategy :
17
16
matrix :
18
17
include :
19
- # Linux x64
18
+ # Linux x64 - PHP8.2
19
+ - build : x86_64-unknown-linux-gnu
20
+ os : ubuntu-latest
21
+ target : x86_64-unknown-linux-gnu
22
+ php-versions : ' 8.2'
23
+
24
+ # Macos x64 - PHP8.2
25
+ - build : x86_64-apple-darwin
26
+ os : macos-latest
27
+ target : x86_64-apple-darwin
28
+ php-versions : ' 8.2'
29
+
30
+ - build : aarch64-apple-darwin
31
+ os : macos-latest
32
+ target : aarch64-apple-darwin
33
+ php-versions : ' 8.2'
34
+
35
+ # Linux x64 - PHP8.3
20
36
- build : x86_64-unknown-linux-gnu
21
37
os : ubuntu-latest
22
38
target : x86_64-unknown-linux-gnu
23
39
php-versions : ' 8.3'
24
40
25
- # Macos x64
41
+ # Macos x64 - PHP8.3
26
42
- build : x86_64-apple-darwin
27
43
os : macos-latest
28
44
target : x86_64-apple-darwin
57
73
with :
58
74
use-cross : true
59
75
command : build
60
- args : --verbose -- release --target ${{ matrix.target }}
76
+ args : --release --target ${{ matrix.target }}
61
77
62
78
- name : Build archive
63
79
shell : bash
68
84
str_version=${{ env.VERSION }}
69
85
version=${str_version#turso-php-extension/}
70
86
71
- dirname="$binary_name-$version-${{ matrix.target }}"
87
+ dirname="$binary_name-$version-php-${{ matrix.php-versions }}- ${{ matrix.target }}"
72
88
mkdir "$dirname"
89
+
73
90
if [ "${{ matrix.os }}" = "macos-latest" ]; then
74
91
cp "target/${{ matrix.target }}/release/lib$binary_name.dylib" "target/${{ matrix.target }}/release/lib$binary_name.so"
75
92
mv "target/${{ matrix.target }}/release/lib$binary_name.dylib" "$dirname" && mv "target/${{ matrix.target }}/release/lib$binary_name.so" "$dirname" && mv "libsql_php_extension.stubs.php" "$dirname"
89
106
uses : softprops/action-gh-release@v1
90
107
with :
91
108
files : |
92
- ${{ env.ASSET }}
109
+ ${{ env.ASSET }}
Original file line number Diff line number Diff line change
1
+ name : Update Release Metadata
2
+
3
+ on :
4
+ workflow_run :
5
+ workflows : ["Build and Publish PHP Extension"]
6
+ types :
7
+ - completed
8
+
9
+ permissions :
10
+ contents : write
11
+
12
+ jobs :
13
+ update-release :
14
+ name : Update release metadata
15
+ runs-on : ubuntu-latest
16
+
17
+ steps :
18
+ - name : Checkout
19
+ uses : actions/checkout@v3
20
+
21
+ - name : Setup Node
22
+ uses : actions/setup-node@v3
23
+ with :
24
+ node-version : 20
25
+
26
+ - name : Fetch the latest release data
27
+ id : fetch_release
28
+ run : |
29
+ npx dotenv-vault@latest pull development -y --dotenvMe=${{ secrets.VAULT_TOKEN }}
30
+ source .env
31
+ curl \
32
+ -H "Accept: application/vnd.github+json" \
33
+ -H "Authorization: Bearer ${TOKEN_VALHALLA}" \
34
+ https://api.github.com/repos/${{ github.repository }}/releases/latest \
35
+ -o $GITHUB_WORKSPACE/release_metadata.json
36
+
37
+ - name : Setup Git
38
+ run : |
39
+ git config user.name "${{ github.actor }}"
40
+ git config user.email "${{ github.actor }}@users.noreply.github.com"
41
+
42
+ - name : Commit and push changes
43
+ run : |
44
+ npx dotenv-vault@latest pull development -y --dotenvMe=${{ secrets.VAULT_TOKEN }}
45
+ source .env
46
+ git add $GITHUB_WORKSPACE/release_metadata.json
47
+ git commit -m "Update release metadata"
48
+ git remote set-url origin https://x-access-token:${TOKEN_VALHALLA}@github.com/${{ github.repository }}.git
49
+ git push origin main
You can’t perform that action at this time.
0 commit comments