-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (47 loc) · 1.67 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
name: Release
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Versionize
run: dotnet tool install --global Versionize
- name: Setup git
run: |
git config --global user.email opencommissioning@spiratec.com
git config --global user.name "oc-bot"
- name: Versioning
id: versionize
run: versionize
continue-on-error: true
- name: Get current version
if: steps.versionize.outcome == 'success'
run: echo "VERSION=v$(versionize inspect)" >> $GITHUB_ENV
- name: Get current changelog
if: steps.versionize.outcome == 'success'
run: echo "$(versionize changelog)" > latest_changelog.md
- name: Dotnet build
if: steps.versionize.outcome == 'success'
run: dotnet build OC.Assistant.Sdk --configuration release --output ./Publish
- name: Push to NuGet
if: steps.versionize.outcome == 'success'
run: dotnet nuget push "./Publish/*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
- name: Push changes to GitHub
if: steps.versionize.outcome == 'success'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true
- name: Publish new release
if: steps.versionize.outcome == 'success'
run: |
gh release create ${{env.VERSION}} -t "Release ${{env.VERSION}}" -F latest_changelog.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}