build: Release version 13.0.0 #63
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: | |
branches: | |
- "*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Set version | |
run: | | |
echo "Buid version is ${{github.run_number}}" | |
sed -i "s/\(<Version>\([0-9]\+\.\)\{2\}\)\([0-9]\+\)/\1${{github.run_number}}/" Ndapi/Ndapi.csproj | |
- name: Cache SonarQube packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache SonarQube scanner | |
id: cache-sonar-scanner | |
uses: actions/cache@v4 | |
with: | |
path: .sonar/scanner | |
key: ${{ runner.os }}-sonar-scanner | |
restore-keys: ${{ runner.os }}-sonar-scanner | |
- name: Install SonarQube scanner | |
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p .sonar/scanner | |
dotnet tool update dotnet-sonarscanner --tool-path .sonar/scanner | |
- name: Build | |
run: | | |
.sonar/scanner/dotnet-sonarscanner begin /k:ndapi /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" | |
dotnet build -c Release | |
.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" | |
- name: Build NuGet package | |
run: dotnet pack -c Release --no-build | |
- name: Build trimmed sample with NativeAOT for Forms 12c | |
run: dotnet publish -c Release -p:"Platform=x64;PublishAot=true" -r linux-x64 samples/CreateModuleDemo/CreateModuleDemo.x64.csproj | |
- name: Add NuGet source | |
run: dotnet nuget add source --username felipebz --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/felipebz/index.json" | |
- name: Publish to GitHub Packages | |
run: dotnet nuget push "Ndapi/**.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source github |