forked from datastax/php-driver
-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from he4rt/feat/gh-release-script
feature(ci): add release github actions
- Loading branch information
Showing
10 changed files
with
185 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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/get-tag@v2.1.3 | ||
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/action-github-changelog-generator@v2.4 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
name: 'Build Docker Images for Testing' | ||
name: "Build Docker Images" | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 1,15 * *' | ||
- cron: "0 0 1,15 * *" | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
tag: ['8.1.29', '8.2.20', '8.3.8'] | ||
zts: [yes, no] | ||
ubuntu_version: ['20.04', '22.04', '24.04'] | ||
tag: ["8.1.29", "8.2.20", "8.3.8"] | ||
zts: ['yes', 'no'] | ||
debug: ['yes', 'no'] | ||
ubuntu_version: ["20.04", "22.04", "24.04"] | ||
uses: "./.github/workflows/docker-image.yml" | ||
with: | ||
php: ${{ matrix.tag }} | ||
zts: ${{ matrix.zts }} | ||
ubuntu_version: ${{ matrix.ubuntu_version }} | ||
debug: ${{ matrix.debug }} | ||
secrets: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# Development | ||
|
||
# 1.3.10 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
#pragma once | ||
|
||
#define PHP_DRIVER_NAME "cassandra" | ||
#define PHP_DRIVER_MAJOR @PHP_SCYLLADB_VERSION_MAJOR@ | ||
#define PHP_DRIVER_MINOR @PHP_SCYLLADB_VERSION_MINOR@ | ||
#define PHP_DRIVER_RELEASE @PHP_SCYLLADB_VERSION_PATCH@ | ||
#define PHP_DRIVER_STABILITY "@PHP_SCYLLADB_STABILITY@" | ||
#define PHP_DRIVER_VERSION "@PHP_SCYLLADB_VERSION@" | ||
#define PHP_DRIVER_VERSION_FULL "@PHP_SCYLLADB_VERSION_FULL@" | ||
#define PHP_DRIVER_VERSION "@PHP_SCYLLADB_VERSION@" |