-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (57 loc) · 1.92 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
66
67
name: Publish
on:
push:
branches:
- master
env:
publish_version: 0.0.${{ github.run_number }}
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
dotnet: [6.0.401]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}
source-url: https://nuget.pkg.github.com/totallymoney/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- run: dotnet tool restore
- run: dotnet paket restore
- run: dotnet build
- run: dotnet run -p ./tests/**/*.fsproj
- id: commit_msg_reader
run: |
LATEST_TAG="$(git describe --tags --abbrev=0)"
MESSAGES_SINCE_TAG="$(git log "$LATEST_TAG".."$GITHUB_SHA" --format="%s <%an>")"
echo "::set-output name=messages::$MESSAGES_SINCE_TAG"
- run: |
dotnet pack \
--output ./out \
--configuration Release \
-p:PackageVersion=${{ env.publish_version }} \
-p:PackageReleaseNotes="${{ steps.commit_msg_reader.outputs.messages }}"
- run: |
dotnet nuget push ./out/*.nupkg \
--api-key ${{ secrets.NUGET_TOKEN }} \
--source https://www.nuget.org
- uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.publish_version }}
release_name: ${{ env.publish_version }}
body: ${{ steps.commit_msg_reader.outputs.messages }}
draft: false
prerelease: false
- uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: out/*.nupkg
tag: ${{ env.publish_version }}
overwrite: true
file_glob: true