-
Notifications
You must be signed in to change notification settings - Fork 41
48 lines (42 loc) · 1.5 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
name: Build
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
# Checkout this repository
- name: Checkout this repository
uses: actions/checkout@v2
# Prepare version
- name: Prepare version
if: startsWith(github.ref, 'refs/tags/v')
run: |
ref="${GITHUB_REF}"
ref="${ref/refs\/tags\/v/}"
echo "::set-output name=VERSION::${ref}"
env:
GITHUB_REF: ${{ github.ref }}
id: get_version
# Publish nuget package
- name: Publish nuget package
if: startsWith(github.ref, 'refs/tags/v')
uses: rohith/publish-nuget@v2
with:
PROJECT_FILE_PATH: src/Edgar/Edgar.csproj
PACKAGE_NAME: Edgar-DotNet
VERSION_STATIC: ${{ steps.get_version.outputs.VERSION }}
TAG_COMMIT: false
NUGET_KEY: ${{ secrets.NUGET_API_KEY }}
# Release
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Trigger api docs build
- name: Trigger api docs build
run: |
curl -XPOST -u "${{secrets.GH_PAT_USERNAME}}:${{secrets.GH_PAT}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/OndrejNepozitek/Edgar-DotNet-ApiDocs/dispatches --data '{"event_type": "build_application"}'