Skip to content

使用 pie 下载扩展 #342

使用 pie 下载扩展

使用 pie 下载扩展 #342

Workflow file for this run

name: build-swoole-cli-windows-msys2
on:
push:
pull_request:
jobs:
windows-msys2:
if: 1
runs-on: windows-2022
steps:
- name: Show Environment Info
shell: cmd
run: |
ver
wmic cpu get name, caption, maxclockspeed, status
systeminfo
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
systeminfo | findstr /B /C:"Manufacturer" /C:"Product" /C:"Version"
set
ipconfig
uname -a
pwd
ipconfig /all
- name: Prepare git
run: |
git config --global core.autocrlf false
git config --global core.eol lf
git config --global core.ignorecase false
git config --global --add safe.directory ${{ github.workspace }}
- uses: actions/checkout@v4
- name: Cache pool
id: cache-msys2-pool
uses: actions/cache@v4
with:
path: "${{ github.workspace }}\\pool\\"
key: "${{ runner.os }}-build-pool-cache"
- uses: msys2/setup-msys2@v2
# https://github.com/msys2/setup-msys2
with:
msystem: MSYS
location: C:\msys2-packages
- name: prepare build environment
shell: msys2 {0}
run: |
bash sapi/quickstart/windows/msys2-build/install-msys2.sh
bash sapi/download-box/download-box-get-archive-from-server.sh
- name: install deps lib with source code
shell: msys2 {0}
run: |
bash ./sapi/scripts/msys2/install-deps-lib.sh
- name: Prepare
shell: msys2 {0}
run: |
bash ./sapi/scripts/msys2/config-ext.sh
- name: Configure
shell: msys2 {0}
run: |
bash ./sapi/scripts/msys2/config.sh
- name: Build
shell: msys2 {0}
run: |
bash ./sapi/scripts/msys2/build.sh
- name: Archive
shell: msys2 {0}
run: |
bash ./sapi/scripts/msys2/archive.sh
- name: Show Build Result
shell: msys2 {0}
run: |
./bin/swoole-cli.exe -v
./bin/swoole-cli.exe -m
./bin/swoole-cli.exe --ri curl
./bin/swoole-cli.exe --ri swoole
./bin/swoole-cli.exe -r "echo PHP_VERSION;"
ldd ./bin/swoole-cli.exe
- name: get app version with bash
shell: msys2 {0}
run: |
APP_VERSION=$(cat ./APP_VERSION)
APP_NAME=$(cat ./APP_NAME)
echo $APP_VERSION
echo $APP_NAME
echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_ENV
echo "APP_NAME=${APP_NAME}" >> $GITHUB_ENV
- name: production artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}-msys2-x64
retention-days: 90
path: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}-msys2-x64.zip
- name: gh release
uses: softprops/action-gh-release@v2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}-msys2-x64.zip
upload-to-cloud-object-storage:
if: 1
runs-on: ubuntu-latest
needs: windows-msys2
steps:
- name: Prepare Run Environment
run:
sudo apt install -y curl
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: upload artifacts to cloud object storage
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
env:
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
run: |
FILE_NAME=$(ls -d swoole-cli-v*-msys2-x64)
FILE="${{ github.workspace }}/${FILE_NAME}/${FILE_NAME}.zip"
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${FILE}