Skip to content

Commit

Permalink
Update release-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
crazywhalecc authored Feb 16, 2024
1 parent be2394b commit aeed04a
Showing 1 changed file with 34 additions and 13 deletions.
47 changes: 34 additions & 13 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ jobs:
php-version:
- "8.1"
micro-version:
- "8.1.26"
- "8.1.27"
operating-system:
- "linux-x86_64"
- "macos-x86_64"
- "linux-aarch64"
- "macos-aarch64"
- "windows-x64"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
Expand Down Expand Up @@ -59,25 +60,45 @@ jobs:

- name: "Download minimal combination"
run: |
curl https://dl.static-php.dev/static-php-cli/minimal/php-${{ matrix.micro-version }}-micro-${{ matrix.operating-system }}.tar.gz -o tmp.tgz
tar -zxvf tmp.tgz
if [ "${{ matrix.operating-system }}" = "windows-x64" ]; then
curl https://dl.static-php.dev/static-php-cli/windows/spc-min/php-${{ matrix.micro-version }}-micro-win.zip -o tmp.zip
unzip tmp.zip
else
curl https://dl.static-php.dev/static-php-cli/minimal/php-${{ matrix.micro-version }}-micro-${{ matrix.operating-system }}.tar.gz -o tmp.tgz
tar -zxvf tmp.tgz
fi
- name: "Generate Executable"
run: |
cat micro.sfx spc.phar > spc
chmod +x spc
if [ "${{ matrix.operating-system }}" = "windows-x64" ]; then
cat micro.sfx spc.phar > spc.exe
else
cat micro.sfx spc.phar > spc
chmod +x spc
fi
- name: "Archive Executable"
run: |
tar -czf spc-${{ matrix.operating-system }}.tar.gz spc
echo "filename=spc-${{ matrix.operating-system }}.tar.gz" >> $GITHUB_ENV
echo "OS=${{ matrix.operating-system }}" >> $GITHUB_ENV
if [ "${{ matrix.operating-system }}" == "linux-x86_64" ]; then
./spc dev:extensions
if [ "${{ matrix.operating-system }}" != "windows-x64" ]; then
tar -czf spc-${{ matrix.operating-system }}.tar.gz spc
echo "filename=spc-${{ matrix.operating-system }}.tar.gz" >> $GITHUB_ENV
echo "OS=${{ matrix.operating-system }}" >> $GITHUB_ENV
if [ "${{ matrix.operating-system }}" == "linux-x86_64" ]; then
./spc dev:extensions
fi
else
echo "filename=spc-${{ matrix.operating-system }}.exe" >> $GITHUB_ENV
echo "OS=${{ matrix.operating-system }}" >> $GITHUB_ENV
fi
- name: "Copy file"
run: "mkdir dist/ && cp ${{ env.filename }} dist/ && cp spc dist/spc-$OS"
run: |
if [ "${{ matrix.operating-system }}" != "windows-x64" ]; then
mkdir dist/ && cp ${{ env.filename }} dist/ && cp spc dist/spc-$OS
else
mkdir dist/ && cp ${{ env.filename }} dist/
echo "SUFFIX=.exe" >> $GITHUB_ENV
fi
- name: upload binaries to release
uses: softprops/action-gh-release@v1
Expand All @@ -100,5 +121,5 @@ jobs:
- name: "Upload Artifact"
uses: actions/upload-artifact@v3
with:
path: spc
path: spc${{ env.SUFFIX }}
name: spc-${{ matrix.operating-system }}

0 comments on commit aeed04a

Please sign in to comment.