Skip to content

Commit

Permalink
Update ci package build
Browse files Browse the repository at this point in the history
  • Loading branch information
FangCunWuChang committed Sep 2, 2024
1 parent 7cb45c2 commit 191753a
Showing 1 changed file with 71 additions and 10 deletions.
81 changes: 71 additions & 10 deletions .github/workflows/buildArtifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,79 @@ on:
workflow_call:

jobs:
prepare-package:
runs-on: ${{matrix.os}}

strategy:
fail-fast: false
matrix:
os: [windows-latest]
compiler: [MSVC, MinGW]
include:
- os: windows-latest
compiler: MSVC
vcpkg_triplet: x64-windows
- os: windows-latest
compiler: MinGW
vcpkg_triplet: x64-mingw-dynamic

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Ninja
uses: ashutoshvarma/setup-ninja@master
with:
version: 1.11.0

- name: Install MinGW
if: matrix.compiler == 'MinGW'
uses: egor-tensin/setup-mingw@v2
with:
platform: x64
static: 0

- name: Install vcpkg Windows
if: runner.os == 'Windows'
working-directory: ${{github.workspace}}/vcpkg
shell: cmd
run: .\bootstrap-vcpkg.bat

- name: Initialize MSVC Environment
if: matrix.compiler == 'MSVC'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{runner.arch}}

- name: Export GitHub Actions Cache Environment Variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install Packages
working-directory: ${{github.workspace}}/vcpkg
shell: pwsh
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
run: vcpkg install --x-manifest-root=../scripts/vcpkg-manifest --x-install-root=./installed --triplet=${{matrix.vcpkg_triplet}}

- name: Archive vcpkg Logs
if: ${{!cancelled()}}
uses: actions/upload-artifact@v4
with:
name: vcpkglogs-${{runner.os}}-${{runner.arch}}-${{matrix.compiler}}-${{steps.short-sha.outputs.sha}}
path: |
vcpkg/buildtrees/*/*.log
retention-days: 7
compression-level: 9

build:
runs-on: ${{matrix.os}}
needs: [prepare-package]

strategy:
fail-fast: false
Expand Down Expand Up @@ -152,13 +223,3 @@ jobs:
path: |
build/${{matrix.build_path}}/bin/**
compression-level: 9

- name: Archive vcpkg Logs
if: ${{!cancelled()}}
uses: actions/upload-artifact@v4
with:
name: vcpkglogs-${{runner.os}}-${{runner.arch}}-${{matrix.compiler}}-${{steps.short-sha.outputs.sha}}
path: |
vcpkg/buildtrees/*/*.log
retention-days: 7
compression-level: 9

0 comments on commit 191753a

Please sign in to comment.