-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 2.01 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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