Update release-build.yml

This commit is contained in:
Jerry Ma 2024-02-17 00:04:02 +08:00 committed by GitHub
parent be2394b39b
commit aeed04a5ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,12 +17,13 @@ jobs:
php-version: php-version:
- "8.1" - "8.1"
micro-version: micro-version:
- "8.1.26" - "8.1.27"
operating-system: operating-system:
- "linux-x86_64" - "linux-x86_64"
- "macos-x86_64" - "macos-x86_64"
- "linux-aarch64" - "linux-aarch64"
- "macos-aarch64" - "macos-aarch64"
- "windows-x64"
steps: steps:
- name: "Checkout" - name: "Checkout"
uses: "actions/checkout@v4" uses: "actions/checkout@v4"
@ -59,25 +60,45 @@ jobs:
- name: "Download minimal combination" - name: "Download minimal combination"
run: | run: |
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 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 tar -zxvf tmp.tgz
fi
- name: "Generate Executable" - name: "Generate Executable"
run: | run: |
if [ "${{ matrix.operating-system }}" = "windows-x64" ]; then
cat micro.sfx spc.phar > spc.exe
else
cat micro.sfx spc.phar > spc cat micro.sfx spc.phar > spc
chmod +x spc chmod +x spc
fi
- name: "Archive Executable" - name: "Archive Executable"
run: | run: |
if [ "${{ matrix.operating-system }}" != "windows-x64" ]; then
tar -czf spc-${{ matrix.operating-system }}.tar.gz spc tar -czf spc-${{ matrix.operating-system }}.tar.gz spc
echo "filename=spc-${{ matrix.operating-system }}.tar.gz" >> $GITHUB_ENV echo "filename=spc-${{ matrix.operating-system }}.tar.gz" >> $GITHUB_ENV
echo "OS=${{ matrix.operating-system }}" >> $GITHUB_ENV echo "OS=${{ matrix.operating-system }}" >> $GITHUB_ENV
if [ "${{ matrix.operating-system }}" == "linux-x86_64" ]; then if [ "${{ matrix.operating-system }}" == "linux-x86_64" ]; then
./spc dev:extensions ./spc dev:extensions
fi fi
else
echo "filename=spc-${{ matrix.operating-system }}.exe" >> $GITHUB_ENV
echo "OS=${{ matrix.operating-system }}" >> $GITHUB_ENV
fi
- name: "Copy file" - 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 - name: upload binaries to release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
@ -100,5 +121,5 @@ jobs:
- name: "Upload Artifact" - name: "Upload Artifact"
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
path: spc path: spc${{ env.SUFFIX }}
name: spc-${{ matrix.operating-system }} name: spc-${{ matrix.operating-system }}