Skip to content

Commit

Permalink
create draft release on tag, publish windows and pecl builds (#109)
Browse files Browse the repository at this point in the history
we already build windows binaries, so let's make them available to users. On each github action, the binaries are published as build artifacts.
When a tag is created, we now create a draft release from the workflow (instead of manually creating the release via the GUI), which means we can also upload the binaries as release artifacts.
Give PECL package the same treatment, so that maintainers don't have to build it manually and upload.
After this is merged, the release process for the extension will change slightly: it relies on a tag being created (but not a release). You can't do that from the GUI, so there's a change coming to dev-tools which will create the tag, and from there the workflow will take care of creating the release in draft form. The final check is for a maintainer to eyeball the release, make any modifications to the text, and publish it.
  • Loading branch information
brettmc authored Nov 15, 2023
1 parent 0458f76 commit 12be89e
Showing 1 changed file with 58 additions and 5 deletions.
63 changes: 58 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and test
name: Build, test, release

on:
push:
Expand All @@ -10,9 +10,8 @@ defaults:
working-directory: ext

jobs:
php:
linux:
runs-on: ubuntu-latest
name: linux
strategy:
fail-fast: false
matrix:
Expand All @@ -23,17 +22,36 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Build
run: |
phpize
./configure
make
- name: Test
env:
TEST_PHP_ARGS: "-q" #do not try to submit failures
run: make test TESTS=--show-diff

pecl-package:
runs-on: ubuntu-latest
container:
image: php:8.2-cli
steps:
- uses: actions/checkout@v3

- name: Package and copy
run: |
mkdir binaries
pear package-validate
pear package
cp opentelemetry-*.tgz binaries/
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: opentelemetry-pecl
path: ext/binaries/*.tgz
if-no-files-found: error

windows:
runs-on: windows-2019
continue-on-error: false
Expand Down Expand Up @@ -65,3 +83,38 @@ jobs:
env:
TEST_PHP_ARGS: "-q"
run: nmake test TESTS=--show-diff
- name: Copy binaries
env:
BUILD_NAME: "opentelemetry-${{matrix.php}}-windows-x64-nts}}"
run: |
md binaries\$BUILD_NAME
copy x64\Release\php_opentelemetry.dll binaries\$BUILD_NAME\php_opentelemetry.dll
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: opentelemetry-${{matrix.php}}-windows-x64-nts
path: ext\x64\Release\php_opentelemetry.dll
if-no-files-found: error

release-if-tag:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [linux, pecl-package, windows]
continue-on-error: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: mkdir
run: mkdir binaries
- name: download-artifacts
uses: actions/download-artifact@v3
with:
path: ext/binaries
- name: zip
run: find ./binaries/* -maxdepth 1 -type d -exec zip -jr {}.zip {} \;
- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
draft: true
files: "**/binaries/*.zip"

0 comments on commit 12be89e

Please sign in to comment.