Merge pull request #273 from K-Society/experimental #204
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 KSociety.Log | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
pull_request: | |
branches: | |
- master | |
- develop | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
NUGET_XMLDOC_MODE: skip | |
jobs: | |
build: | |
name: Build | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set package source | |
run: dotnet nuget add source --username maniglia --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/K-Society/index.json" | |
- name: Get Version | |
uses: dotnet/nbgv@master | |
id: nbgv | |
- run: | | |
echo 'SemVer2=${{ steps.nbgv.outputs.SemVer2 }}' | |
echo 'SimpleVersion=${{ steps.nbgv.outputs.SimpleVersion }}' | |
- name: Build KSociety.Log net8.0 | |
shell: cmd | |
run: ./build.cmd net8.0 | |
- name: Zip Installer net8.0 | |
shell: pwsh | |
run: Compress-Archive -LiteralPath .\build\KSociety.Log.Install\bin\Release\net8.0\KSociety.Log.Install-${{ steps.nbgv.outputs.SimpleVersion }}-net8.0.exe -DestinationPath .\build\KSociety.Log.Install\bin\Release\net8.0\K-Society.Log-${{ steps.nbgv.outputs.SimpleVersion }}-net8.0.zip -Force | |
- name: Push to GitHub Packages | |
if: github.event_name == 'push' && github.repository_owner == 'K-Society' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') | |
run: dotnet nuget push "build/**/bin/Release/*.nupkg" --source https://nuget.pkg.github.com/K-Society/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate | |
- name: Push to NuGet Packages | |
if: github.event_name == 'push' && github.repository_owner == 'K-Society' && (github.ref == 'refs/heads/master') | |
run: nuget push build/**/bin/Release/*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: github.event_name == 'push' && github.repository_owner == 'K-Society' && (github.ref == 'refs/heads/master') | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
draft: false | |
prerelease: false | |
name: K-Society.Log ${{ steps.nbgv.outputs.SimpleVersion }} | |
tag_name: ${{ steps.nbgv.outputs.SimpleVersion }} | |
files: | | |
./build/KSociety.Log.Install/bin/Release/net8.0/K-Society.Log-${{ steps.nbgv.outputs.SimpleVersion }}-net8.0.zip | |