From 5789b3d5e75696c286ddf30663d3558935166d3f Mon Sep 17 00:00:00 2001 From: James Titcumb Date: Thu, 3 Oct 2024 21:24:27 +0100 Subject: [PATCH 1/3] Build nightly phar into docs package --- .github/workflows/continuous-integration.yml | 29 +--------------- .github/workflows/docs.yml | 13 ++++++- .github/workflows/release-unsigned-phar.yml | 36 ++++++++++++++++++++ 3 files changed, 49 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/release-unsigned-phar.yml diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 46887f00..07185e33 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -96,31 +96,4 @@ jobs: - unit-tests - coding-standards - static-analysis - runs-on: ${{ matrix.operating-system }} - strategy: - matrix: - operating-system: - - ubuntu-latest - php-versions: - - '8.1' - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - coverage: none - tools: composer, box - php-version: "${{ matrix.php-version }}" - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - # Temporary until we have a first tag; Box needs at least one tag to exist! - - run: git describe --tags HEAD || git tag 0.0.0 - - uses: ramsey/composer-install@v3 - - name: Build PHAR - run: box compile - - name: Check the PHAR executes - run: php pie.phar --version - - uses: actions/upload-artifact@v4 - with: - name: pie-${{ github.sha }}.phar - path: pie.phar + uses: ./.github/workflows/release-unsigned-phar.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3f7488ba..4b505efd 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,7 +3,7 @@ name: "Publish Documentation microsite" on: # Runs on pushes targeting the default branch push: - branches: ["main"] + branches: ["include-nightly-phar"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -21,14 +21,25 @@ concurrency: cancel-in-progress: false jobs: + build-phar: + uses: ./.github/workflows/release-unsigned-phar.yml + # Build job build: runs-on: ubuntu-latest + needs: + - build-phar steps: - name: Checkout uses: actions/checkout@v4 - name: Build documentation run: .github/docs/build-docs.sh + - name: Fetch built PHAR from artifacts + uses: actions/download-artifact@v4 + with: + name: pie-${{ github.sha }}.phar + - name: Copy PHAR into docs + run: cp pie.phar docs-package/pie-nightly.phar - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: diff --git a/.github/workflows/release-unsigned-phar.yml b/.github/workflows/release-unsigned-phar.yml new file mode 100644 index 00000000..7cffb9b4 --- /dev/null +++ b/.github/workflows/release-unsigned-phar.yml @@ -0,0 +1,36 @@ +name: "Release unsigned PHAR" + +on: + workflow_call: + +jobs: + + build-phar: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: + - ubuntu-latest + php-versions: + - '8.1' + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + coverage: none + tools: composer, box + php-version: "${{ matrix.php-version }}" + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + # Temporary until we have a first tag; Box needs at least one tag to exist! + - run: git describe --tags HEAD || git tag 0.0.0 + - uses: ramsey/composer-install@v3 + - name: Build PHAR + run: box compile + - name: Check the PHAR executes + run: php pie.phar --version + - uses: actions/upload-artifact@v4 + with: + name: pie-${{ github.sha }}.phar + path: pie.phar From 9bb0d9c58517796dc3fc823d3880f7f192f33338 Mon Sep 17 00:00:00 2001 From: James Titcumb Date: Thu, 3 Oct 2024 21:46:09 +0100 Subject: [PATCH 2/3] Added location for nightly PHAR --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1432bf83..799553ba 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,9 @@ please read [extension-maintainers](./docs/extension-maintainers.md). ### Manual installation -- Download `pie.phar` from the [latest releases](https://github.com/php/pie/releases) +- Download `pie.phar` either: + - [latest stable release](https://github.com/php/pie/releases) + - [latest unstable nightly](https://php.github.io/pie/pie-nightly.phar) - Validate the signature in `pie.phar.asc` - You may then invoke PIE with `php pie.phar ` From f2b4fb6995e952615bcffb9ceed8482674785526 Mon Sep 17 00:00:00 2001 From: James Titcumb Date: Thu, 3 Oct 2024 21:48:57 +0100 Subject: [PATCH 3/3] Run docs flow on main only --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4b505efd..b0c33be3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,7 +3,7 @@ name: "Publish Documentation microsite" on: # Runs on pushes targeting the default branch push: - branches: ["include-nightly-phar"] + branches: ["main"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: