mirror of
https://github.com/php-win-ext/MaxMind-DB-Reader-php-ext.git
synced 2026-03-24 00:52:14 +01:00
59 lines
2.0 KiB
YAML
59 lines
2.0 KiB
YAML
name: Build extension
|
|
on:
|
|
# When a new release is created, we can build, and upload the DLLs to it.
|
|
release:
|
|
types: [created]
|
|
push: # Uncomment this to run on push to a branch
|
|
branches: ['**']
|
|
# create: # Uncomment this to run on tag/branch creation
|
|
# pull_request: # Uncomment this to run on pull requests
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
# This job generates a matrix of PHP versions, architectures, and thread safety options
|
|
# This is done by reading the constraints from composer.json or the package.xml file.
|
|
# Please refer to https://github.com/php/php-windows-builder#get-the-job-matrix-to-build-a-php-extension
|
|
get-extension-matrix:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.extension-matrix.outputs.matrix }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Get the extension matrix
|
|
id: extension-matrix
|
|
uses: php/php-windows-builder/extension-matrix@v1
|
|
|
|
# This job builds the extension on Windows using the matrix generated from the previous job.
|
|
build:
|
|
needs: get-extension-matrix
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix: ${{fromJson(needs.get-extension-matrix.outputs.matrix)}}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Build the extension
|
|
uses: php/php-windows-builder/extension@v1
|
|
with:
|
|
# Always specify the php-version, arch, and ts as they are required inputs.
|
|
# Please refer to https://github.com/php/php-windows-builder#build-a-php-extension
|
|
php-version: ${{ matrix.php-version }}
|
|
arch: ${{ matrix.arch }}
|
|
ts: ${{ matrix.ts }}
|
|
|
|
# This job uploads the built artifacts to the GitHub release.
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
if: ${{ github.event_name == 'release' }}
|
|
steps:
|
|
- name: Upload artifact to the release
|
|
uses: php/php-windows-builder/release@v1
|
|
with:
|
|
release: ${{ github.event.release.tag_name }}
|
|
token: ${{ secrets.GITHUB_TOKEN }} |