Merge pull request #153 from K-Society/experimental #339
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.SharpCubeProgrammer | |
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.SharpCubeProgrammer | |
shell: cmd | |
run: ./build.cmd | |
- name: Bump version and push tag | |
if: github.event_name == 'push' && github.repository_owner == 'K-Society' && (github.ref == 'refs/heads/master') | |
id: tag_version | |
uses: mathieudutour/github-tag-action@v6.1 | |
with: | |
custom_tag: ${{ steps.nbgv.outputs.SimpleVersion }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- 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 }} | |