-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (48 loc) · 2.04 KB
/
build.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
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 }}