feat: adapt source generation #148
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
configuration: [ Release ] | |
runtime-identifier: [ 'win-x64', 'win-arm64', 'linux-x64', 'linux-arm64', 'osx-x64', 'osx-arm64' ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup .NET Core SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.x | |
- name: Publish the application | |
run: dotnet publish OKP.Core --configuration ${{ matrix.configuration }} --runtime ${{ matrix.runtime-identifier }} --self-contained false | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: OKP.Core-${{ matrix.runtime-identifier }}-${{ matrix.configuration }} | |
path: | | |
OKP.Core/bin/${{ matrix.configuration }}/net8.0/${{ matrix.runtime-identifier }}/publish/* | |
!OKP.Core/bin/${{ matrix.configuration }}/net8.0/${{ matrix.runtime-identifier }}/publish/*.pdb | |
!OKP.Core/bin/${{ matrix.configuration }}/net8.0/${{ matrix.runtime-identifier }}/publish/*.dbg | |
!OKP.Core/bin/${{ matrix.configuration }}/net8.0/${{ matrix.runtime-identifier }}/publish/*.dwarf | |
glue: | |
name: 'Build (Release, osx-universal)' | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup working directory | |
run: | | |
mkdir -p OKP.Core/bin/Release/net8.0/osx-x64/publish | |
mkdir -p OKP.Core/bin/Release/net8.0/osx-arm64/publish | |
- name: Setup lipo | |
run: | | |
curl -L -o /tmp/lipo https://github.com/konoui/lipo/releases/latest/download/lipo_Linux_amd64 | |
chmod +x /tmp/lipo | |
sudo mv /tmp/lipo /usr/local/bin/lipo | |
- name: Download x64 build | |
uses: actions/download-artifact@v3 | |
with: | |
name: OKP.Core-osx-x64-Release | |
path: OKP.Core/bin/Release/net8.0/osx-x64/publish | |
- name: Download arm64 build | |
uses: actions/download-artifact@v3 | |
with: | |
name: OKP.Core-osx-arm64-Release | |
path: OKP.Core/bin/Release/net8.0/osx-arm64/publish | |
- name: Glue the binary | |
run: | | |
mkdir -p OKP.Core/bin/Release/net8.0/osx-universal/publish | |
lipo -create OKP.Core/bin/Release/net8.0/osx-x64/publish/OKP.Core OKP.Core/bin/Release/net8.0/osx-arm64/publish/OKP.Core -output OKP.Core/bin/Release/net8.0/osx-universal/publish/OKP.Core | |
mv OKP.Core/bin/Release/net8.0/osx-x64/publish/config OKP.Core/bin/Release/net8.0/osx-universal/publish/config | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: OKP.Core-osx-universal-Release | |
path: | | |
OKP.Core/bin/Release/net8.0/osx-universal/publish/* | |
!OKP.Core/bin/Release/net8.0/osx-universal/publish/*.pdb | |
!OKP.Core/bin/Release/net8.0/osx-universal/publish/*.dbg | |
!OKP.Core/bin/Release/net8.0/osx-universal/publish/*.dwarf |