Skip to content

Commit

Permalink
Create opus_lib_x64.yml (#14)
Browse files Browse the repository at this point in the history
Create universal opus lib workflow
  • Loading branch information
ashipo committed Apr 17, 2024
1 parent 68caaf2 commit bc30d45
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/opus_lib_x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build and cache opus lib x64

on:
workflow_call:
inputs:
opus-version:
required: true
type: string

jobs:
check-cache:
runs-on: windows-2022
outputs:
cache-hit: ${{ steps.cache-check-opus.outputs.cache-hit }}
steps:
- name: Check cache
id: cache-check-opus
uses: actions/cache/restore@v4
with:
key: opus-lib-${{ inputs.opus-version }}-x64
path: opus-lib/${{ inputs.opus-version }}/x64
lookup-only: true

build:
needs: check-cache
if: needs.check-cache.outputs.cache-hit != 'true'
runs-on: windows-2022
env:
OPUS_SOLUTION_FILE_PATH: cmake
BUILD_CONFIGURATION: MinSizeRel
steps:
- name: Init environment files
run: |
echo "CACHE_KEY=opus-lib-${{ inputs.opus-version }}-x64" >> $env:GITHUB_ENV
echo "CACHE_PATH=opus-lib/${{ inputs.opus-version }}/x64" >> $env:GITHUB_ENV
- name: Checkout opus
uses: actions/checkout@v4
with:
repository: xiph/opus
ref: ${{ inputs.opus-version }}

- name: Generate solution
run: |
cd cmake
cmake .. -G "Visual Studio 17 2022" -A x64
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Build
run: msbuild ${{ env.OPUS_SOLUTION_FILE_PATH }}/opus.vcxproj -m -p:PlatformToolset=v143 -p:Configuration=${{ env.BUILD_CONFIGURATION }} -p:Platform=x64 -p:OutDir="${{ github.workspace }}/${{ env.CACHE_PATH }}/"

- name: Cache
uses: actions/cache/save@v4
with:
key: ${{ env.CACHE_KEY }}
path: ${{ env.CACHE_PATH }}

0 comments on commit bc30d45

Please sign in to comment.