forked from he4rt/scylladb-php-driver
-
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (98 loc) · 3.52 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: "Release"
permissions:
contents: write
on:
push:
tags:
- "v*"
jobs:
tag:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tag.outputs.tag }}
prerelease: ${{ (!!steps.prerelease.outputs.is_prerelease) || false }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Get Tag
if: startsWith(github.ref, 'refs/tags/v')
uses: olegtarasov/[email protected]
id: tag
with:
tagRegex: "v(.*)"
- name: Get Prerelease
if: contains(github.ref, '-rc') || contains(github.ref, '-pre') || contains(github.ref, '-alpha') || contains(github.ref, '-beta')
run: echo "is_prerelease=true" >> $GITHUB_OUTPUT
id: prerelease
build:
runs-on: ubuntu-latest
needs: ['tag']
strategy:
matrix:
php: ['8.1', '8.1-zts', '8.2', '8.2-zts', '8.3', '8.3-zts']
os: ['ubuntu-20.04', 'ubuntu-24.04']
preset: ['CICassandra', 'CIScylla']
fail-fast: true
container: malusevd99/scylladb-php-driver:${{ matrix.os }}-php-${{ matrix.php }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Extract PHP Version and ZTS
id: name
run: |
[ "CICassandra" = "${{ matrix.preset }}" ] && echo 'extension="cassandra-${{ matrix.os }}-${{ matrix.php }}"' >> $GITHUB_ENV
[ "CIScylla" = "${{ matrix.preset }}" ] && echo 'extension="scylla-${{ matrix.os }}-${{ matrix.php }}"' >> $GITHUB_ENV
- name: Build Driver
run: |
cmake --preset ${{ matrix.preset }} -DPHP_SCYLLADB_VERSION=${{ needs.tag.outputs.version }} || exit 1
cd out/${{ matrix.preset }} || exit 1
ninja build || exit 1
cd ../../
mv out/${{ matrix.preset }}/cassandra.so || exit 1
sed -i "s/extension = cassandra/extension = ${{ steps.name.outputs.extension }}/g" cassandra.ini || exit 1
tar czf ${{ steps.name.outputs.extension }}.tar.gz ${{ steps.name.outputs.extension }}.so cassandra.ini
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.name.outputs.extension }}
path: ${{ steps.name.outputs.extension }}.tar.gz
if-no-files-found: error
retention-days: 5
overwrite: true
release:
runs-on: ubuntu-latest
needs: ["build", 'tag']
steps:
- uses: actions/download-artifact@v4
id: artifacts
with:
merge-multiple: true
- name: Release
uses: softprops/action-gh-release@v2
id: release
with:
make_latest: ${{ !needs.tag.outputs.prerelease }}
name: "v${{ needs.tag.outputs.version }}"
tag_name: "v${{ needs.tag.outputs.version }}"
generate_release_notes: true
append_body: true
prerelease: ${{ needs.tag.outputs.prerelease }}
files: |
${{ steps.artifacts.outputs.download-path }}/*.tar.gz
fail_on_unmatched_files: true
- name: "Generate release changelog"
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
author: true
releaseUrl: ${{ steps.release.outputs.url }}
issues: true
pullRequests: true
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update CHANGELOG.md"
branch: v1.3.x
commit_options: "--no-verify --signoff"
file_pattern: CHANGELOG.md