forked from jcoutch/NCrontab-Advanced
-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (56 loc) · 2.1 KB
/
release.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
66
67
68
69
70
name: release
on:
push:
tags:
- v*
env:
CONFIGURATION: Release
DOTNET_NOLOGO: true
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
release:
runs-on: windows-latest
timeout-minutes: 15
permissions:
packages: write
contents: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: restore
run: dotnet restore
- name: build
run: dotnet build --no-restore
- name: pack
run: dotnet pack --no-build -o bin
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: packages
path: bin/*.nupkg
- name: deploy github.com
run: find bin -name '*.nupkg' | xargs dotnet nuget push -s $NUGET_SOURCE -k $NUGET_KEY --skip-duplicate --force-english-output
shell: bash
env:
NUGET_SOURCE: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
NUGET_KEY: ${{ secrets.GITHUB_TOKEN }}
- name: deploy nuget.org
run: find bin -name '*.nupkg' | xargs dotnet nuget push -s $NUGET_SOURCE -k $NUGET_KEY --skip-duplicate --force-english-output
shell: bash
env:
NUGET_SOURCE: https://api.nuget.org/v3/index.json
NUGET_KEY: ${{ secrets.NUGET_API_KEY }}
- uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # v1.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{ contains(github.ref_name, '-') }}