Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for static binary in GHA #291

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions .github/workflows/artefacts.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build phars
name: Build phars and static binaries

on:
push:
Expand Down Expand Up @@ -52,10 +52,37 @@ jobs:
path: tools/phar/build/castor.windows-amd64.phar
if-no-files-found: error

static:
needs: phar
name: Create static binaries and upload them as an artifact
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: ./.github/actions/install

- uses: ./.github/actions/cache

- name: retrieve phar artifacts
uses: actions/download-artifact@v4
with:
path: tools/phar/build
merge-multiple: true

- uses: ./.github/actions/static

- name: Upload the Linux static binary
uses: actions/upload-artifact@v4
with:
name: 'castor.linux-amd64'
path: ./castor.linux.x86_64
if-no-files-found: error

release:
name: Upload phars to the release
name: Upload phars and static binaries to the release
if: github.event_name == 'release'
needs: [phar]
needs: [phar, static]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -69,8 +96,14 @@ jobs:

- name: Upload files
run: |
# Weird, in the artefacts, the binary is ./build/castor.linux-amd64, but
# when we download it, it's ./castor.linux.x86_64 (the old name)
if [ -f ./build/castor.linux.x86_64 ]; then
mv ./build/castor.linux.x86_64 ./build/castor.linux-amd64
fi
gh release upload ${{ github.ref_name }} ./build/castor.darwin-amd64.phar
gh release upload ${{ github.ref_name }} ./build/castor.darwin-arm64.phar
gh release upload ${{ github.ref_name }} ./build/castor.linux-amd64
gh release upload ${{ github.ref_name }} ./build/castor.linux-amd64.phar
gh release upload ${{ github.ref_name }} ./build/castor.windows-amd64.phar
env:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Allow to listen to the symfony console events
* Add a `compile` command that puts together a customizable PHP binary with a
repacked castor app into one executable file
* Distribute `castor.linux.amd64` automatically with the release
lyrixx marked this conversation as resolved.
Show resolved Hide resolved
* Set the process title according to the current application name and task name
* Compile watcher and phar for `ARM64` on macOS
* Deprecates `add_context()` function, use `AsContextGenerator` attribute
Expand Down