publish #12
Workflow file for this run
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: publish | |
on: | |
create: | |
tags: | |
- "v*.*.*" | |
jobs: | |
build: | |
name: Build and Release | |
if: ${{ StartsWith(github.ref, 'refs/tags/') }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: '0' | |
submodules: 'recursive' | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 6.0.x | |
#- name: Restore dependencies | |
# run: dotnet restore | |
- name: dotnet pack | |
run: | | |
dotnet nuget add source --username Milkitic --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Milkitic/index.json" | |
dotnet build src/KbinXml.Net --configuration Release -p:CI=true | |
dotnet pack src/KbinXml.Net --configuration Release --output ci-pack -p:CI=true | |
- name: action-minver | |
uses: thefringeninja/[email protected] | |
id: version | |
with: | |
tag-prefix: v | |
minimum-major-minor: 1.0 | |
- name: Create a new GitHub release if a new tag is pushed | |
uses: softprops/action-gh-release@v1 | |
if: ${{ success() && startsWith(github.ref, 'refs/tags/') }} | |
env: | |
GITHUB_TOKEN: ${{secrets.MILKI_TOKEN}} | |
with: | |
name: v${{ steps.version.outputs.version }} | |
prerelease: true | |
draft: false | |
files: | | |
./ci-pack/KbinXml.Net.${{ steps.version.outputs.version }}.nupkg | |
- name: Create Github Package | |
if: ${{ success() }} | |
run: | | |
dotnet nuget push "./ci-pack/KbinXml.Net.${{ steps.version.outputs.version }}.nupkg" --api-key ${{secrets.MILKI_TOKEN}} --source "github" | |
- name: Nuget Publish KbinXml.Net | |
uses: Rebel028/[email protected] | |
with: | |
PROJECT_FILE_PATH: src/KbinXml.Net/KbinXml.Net.csproj | |
VERSION_STATIC: ${{ steps.version.outputs.version }} | |
NUGET_KEY: ${{secrets.NUGET_API_KEY}} | |
GITHUB_USER: Milkitic | |
TAG_COMMIT: false |