Skip to content

Release binaries

Release binaries #1

Workflow file for this run

name: Release binaries
on:
push:
tags:
- 'v[0-9]*.[0-9]*.**'
permissions:
contents: read
jobs:
create-draft-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-tags: 'true'
ref: ${{ github.ref }}
- name: Create draft release from tag
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "${{ github.ref_name }}" --draft --generate-notes --verify-tag
windows-extension-matrix:
needs: [create-draft-release]
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.extension-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v6
- name: Get the extension matrix
id: extension-matrix
uses: php/php-windows-builder/extension-matrix@v1
with:
php-version-list: '8.0, 8.1, 8.2, 8.3, 8.4, 8.5'
windows-build:
needs: [windows-extension-matrix]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.windows-extension-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v6
- name: Set version in source code
shell: powershell
run: |
$tag = "${{ github.ref_name }}"
$version = $tag -replace '^v', ''
Write-Host "Update version to: $version"
$filePath = "php_rar.h"
(Get-Content $filePath) -replace '(PHP_RAR_VERSION\s+)"[^"]+"', ('$1' + "`"$version`"") | Set-Content $filePath
Write-Host "File $filePath updated."
- name: Build the extension for Windows
uses: php/php-windows-builder/extension@v1
with:
php-version: ${{ matrix.php-version }}
arch: ${{ matrix.arch }}
ts: ${{ matrix.ts }}
args: --enable-rar=shared
test-runner: run-tests-rar.php
windows-release:
needs: [windows-build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Generate build provenance attestation
if: github.event_name != 'pull_request'
uses: actions/attest@v4
with:
subject-path: 'artifacts/php*'
- name: Upload artifacts to the release
uses: php/php-windows-builder/release@v1
with:
release: ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: 'true'