fix: infer# action #215
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 and Upload | |
on: | |
push: | |
branches: [ master, feat/**, release/** ] | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
env: | |
DOTNET_VERSION: net9.0 | |
jobs: | |
build: | |
name: 'Build' | |
runs-on: ubuntu-24.04-arm | |
strategy: | |
matrix: | |
configuration: [ 'Release' ] | |
runtime-identifier: [ 'win-x64', 'linux-x64', 'osx-x64', 'osx-arm64' ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET 9.x | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.x | |
cache: true | |
cache-dependency-path: | | |
src/ISTA-Patcher/packages.lock.json | |
src/ISTAlter/packages.lock.json | |
- name: Restore dependencies | |
run: | | |
dotnet restore src/ISTA-Patcher/ISTA-Patcher.csproj --locked-mode | |
dotnet restore src/ISTAlter/ISTAlter.csproj --locked-mode | |
- name: Update version info | |
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
run: | | |
proj_file="src/ISTA-Patcher/ISTA-Patcher.csproj" | |
version="<InformationalVersion>$(git rev-parse --short HEAD)</InformationalVersion>" | |
sed -i "s#<InformationalVersion>[^<]*<\/InformationalVersion>#$version#g" $proj_file | |
- name: Publish the application | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
run: dotnet publish src/ISTA-Patcher --configuration ${{ matrix.configuration }} --runtime ${{ matrix.runtime-identifier }} --no-self-contained -p:IncludeNativeLibrariesForSelfExtract=true | |
- name: Copy files | |
run: | | |
cp -f LICENSE src/ISTA-Patcher/bin/${{ matrix.configuration }}/${{ env.DOTNET_VERSION }}/${{ matrix.runtime-identifier }}/publish/LICENSE | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ISTA-Patcher-${{ matrix.runtime-identifier }}-${{ matrix.configuration }} | |
retention-days: 14 | |
path: | | |
src/ISTA-Patcher/bin/${{ matrix.configuration }}/${{ env.DOTNET_VERSION }}/${{ matrix.runtime-identifier }}/publish/* | |
!src/ISTA-Patcher/bin/${{ matrix.configuration }}/${{ env.DOTNET_VERSION }}/${{ matrix.runtime-identifier }}/publish/*.pdb | |
!src/ISTA-Patcher/bin/${{ matrix.configuration }}/${{ env.DOTNET_VERSION }}/${{ matrix.runtime-identifier }}/publish/*.dbg | |
glue: | |
name: 'Build (Release, osx-universal)' | |
needs: build | |
runs-on: ubuntu-24.04-arm | |
steps: | |
- name: Setup working directory | |
run: | | |
mkdir -p src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-x64/publish | |
mkdir -p src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-arm64/publish | |
- name: Setup lipo | |
run: | | |
curl -L -o /tmp/lipo https://github.com/konoui/lipo/releases/latest/download/lipo_Linux_arm64 | |
chmod +x /tmp/lipo | |
sudo mv /tmp/lipo /usr/local/bin/lipo | |
- name: Download x64 build | |
uses: actions/download-artifact@v4 | |
with: | |
name: ISTA-Patcher-osx-x64-Release | |
path: src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-x64/publish | |
- name: Download arm64 build | |
uses: actions/download-artifact@v4 | |
with: | |
name: ISTA-Patcher-osx-arm64-Release | |
path: src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-arm64/publish | |
- name: Glue the binary | |
run: | | |
mkdir -p src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-universal/publish | |
lipo -create src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-x64/publish/ISTA-Patcher src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-arm64/publish/ISTA-Patcher -output src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-universal/publish/ISTA-Patcher | |
- name: Copy files | |
run: | | |
cp -f src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-x64/publish/LICENSE src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-universal/publish/LICENSE | |
cp -f src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-x64/publish/patch-config.json src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-universal/publish/patch-config.json | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ISTA-Patcher-osx-universal-Release | |
retention-days: 14 | |
path: | | |
src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-universal/publish/* | |
!src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-universal/publish/*.pdb | |
!src/ISTA-Patcher/bin/Release/${{ env.DOTNET_VERSION }}/osx-universal/publish/*.dwarf |