Skip to content

Updated PHAR release script#522

Closed
asgrim wants to merge 2 commits into7.1.xfrom
phar-release-script
Closed

Updated PHAR release script#522
asgrim wants to merge 2 commits into7.1.xfrom
phar-release-script

Conversation

@asgrim
Copy link
Member

@asgrim asgrim commented May 22, 2022

Fixes #374

NOTE - I have not tested this end to end - not entirely sure how to set up GPG to use the private key without nuking my own private key.

The phar builds (example attached, zipped so that GH accepts it) but I'm not sure how to test the signing

roave-backward-compatibility-check.zip
.

@asgrim asgrim added enhancement github_actions Pull requests that update Github_actions code labels May 22, 2022
@asgrim asgrim requested a review from Ocramius May 22, 2022 10:30
- name: "build-phar.sh"
run: "build-phar.sh"
- name: "Build and sign phar file via phing"
run: "vendor/bin/phing phar-build phar-sign"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to run phar-build locally to produce a phar (attached to the main PR description), but I am not sure how to test the signing, and uploading the PHAR to the release.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to do a release 😬

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be reverted

- name: "build-phar.sh"
run: "build-phar.sh"
- name: "Build and sign phar file via phing"
run: "vendor/bin/phing phar-build phar-sign"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to do a release 😬

<!-- http://www.phing.info/get/phing-latest.phar -->
<!-- php -d phar.readonly=Off phing-latest.phar phar-build-release -->
<!-- ============================================================== -->
<project name="roave-backward-compatibility-check" default="phar-build">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the fresh hell do we need phing, and why does it still exist? 😱

],
"require-dev": {
"doctrine/coding-standard": "^9.0.0",
"phing/phing": "^2.17",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nopenopenope 🤣

<!--create the package-->
<mkdir dir="${build-dir}" />
<php expression="file_put_contents('bin/clistub.php', '#!/usr/bin/env php' . chr(10) . Phar::createDefaultStub('bin/roave-backward-compatibility-check.php'))"/>
<pharpackage basedir="./"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really shouldn't drag in phing for just this 😬

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just based off the suggested approach in maglnet/ComposerRequireChecker - which uses Phing's PHAR packager to make this heh

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup - I think we just need to extract this specific step to be done via bash, and then we are good 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it isn't too much Voodoo: https://github.com/phingofficial/phing/blob/d98239f270e86c6a886eb93893d5ddd17c9d71bd/src/Phing/Task/System/PharPackageTask.php

Only dependency becomes ext-phar in require-dev

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for bothering: any update on this? Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, yeah, looking at https://github.com/maglnet/ComposerRequireChecker/blob/fb2a69aa2b7307541233536f179275e99451b339/.github/workflows/phar-creation.yml#L32, there's no real way around it.

We could have a tools/phing/composer.json, but let's roll with the current solution for now, if you are happy with it.

I can extract it from here later, if it becomes a problem: would really rather not have phing in my big list of problems, but it is what it is :D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if @theseer might be working a tool: https://phpc.social/@theseer/109296480712703364

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just go with what works now and unblocks @sebastianbergmann, and then we suffer later in trying to extract it from our pipeline again :P

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll take a look at this again and refresh myself, haven't looked at it for a while and probably needs a rebase etc 😁

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if @theseer might be working a tool: phpc.social/@theseer/109296480712703364

This is work in progress and in early design phase on my side.
Given I'm currently quite busy, this is likely not to materialize very soon :-(

@mfn
Copy link

mfn commented Mar 22, 2026

Isn't this obsolete since the PHAR build process has been removed? -> #770

@Ocramius
Copy link
Member

Yup, thanks for noticing, @mfn

@Ocramius Ocramius closed this Mar 22, 2026
@Ocramius Ocramius deleted the phar-release-script branch March 22, 2026 15:01
@mfn
Copy link

mfn commented Mar 22, 2026

I actually was searching for the PHAR for CI integration but first found this issue and was in hopes until I found the other 😭

@Ocramius
Copy link
Member

@mfn the correct way to do this, in my (long standing) opinion:

  • make a tools/ directory
  • add a composer.json and composer.lock to just that directory
  • run the tool from ./tools/vendor/bin/roave-backward-compatibility-check

mfn added a commit to rebing/graphql-laravel that referenced this pull request Mar 22, 2026
…check

- Install roave/backward-compatibility-check in isolated composer root
  at tools/bc-check/ to avoid dependency conflicts
  See recommendation from Roave/BackwardCompatibilityCheck#522 (comment)
- Add bin/update-bc-baseline.php for generating and managing the
  baseline XML (supports --strip-baseline to clear before regeneration)
- Generate initial baseline for known v9 to v10 intentional breaks
mfn added a commit to rebing/graphql-laravel that referenced this pull request Mar 22, 2026
…check

- Install roave/backward-compatibility-check in isolated composer root
  at tools/bc-check/ to avoid dependency conflicts
  See recommendation from Roave/BackwardCompatibilityCheck#522 (comment)
- Add bin/update-bc-baseline.php for generating and managing the
  baseline XML (supports --strip-baseline to clear before regeneration)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement github_actions Pull requests that update Github_actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phar release is not created

5 participants