-
-
Notifications
You must be signed in to change notification settings - Fork 15
60 lines (54 loc) · 1.99 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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Release
on:
push:
tags:
- '*'
jobs:
release:
strategy:
matrix:
dotnet: [6.0.200]
runs-on: ubuntu-20.04
steps:
# this step uses bash parameter substring removal to strip the leading refs/tags/ from the tag name
- name: Get version from tag
id: tag_name
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/}
shell: bash
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.tag_name.outputs.current_version }}
path: ./CHANGELOG.md
- name: Restore tools
run: dotnet tool restore
- name: Run build
run: dotnet build -c Release /p:Version=${{ steps.tag_name.outputs.current_version }}
- name: Create package
run: dotnet pack -c Release /p:Version=${{ steps.tag_name.outputs.current_version }} /p:PackageReleaseNotes="${{ steps.changelog_reader.outputs.changes }}" -o ./bin
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.changelog_reader.outputs.version }}
name : Release ${{ steps.changelog_reader.outputs.version }}
body: ${{ steps.changelog_reader.outputs.changes }}
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
files: |
./bin/FsAst.*.nupkg
- name: Publish package to nuget
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
run: dotnet nuget push ./bin/FsAst.*.nupkg --api-key $NUGET_KEY --source https://api.nuget.org/v3/index.json