-
-
Notifications
You must be signed in to change notification settings - Fork 5
55 lines (53 loc) · 1.5 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
name: .NET Publish
on:
push:
tags:
- "*"
env:
CONFIGURATION: Release
jobs:
set_version:
runs-on: ubuntu-latest
steps:
- name: Set Versions
uses: actions/github-script@v6
id: set_version
with:
script: |
const tag = context.ref.substring(10)
const no_v = tag.replace('v', '')
const dash_index = no_v.lastIndexOf('-')
const no_dash = (dash_index > -1) ? no_v.substring(0, dash_index) : no_v
core.setOutput('tag', tag)
core.setOutput('no-v', no_v)
core.setOutput('no-dash', no_dash)
outputs:
tag: ${{ steps.set_version.outputs.tag }}
no-v: ${{ steps.set_version.outputs.no-v }}
no-dash: ${{ steps.set_version.outputs.no-dash }}
build:
needs: set_version
environment:
name: nuget
url: https://www.nuget.org/packages/IcedTasks/${{ needs.set_version.outputs.no-v }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup necessary dotnet SDKs
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json
dotnet-version: |
8.x
7.x
6.x
- name: publish
env:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FAKE_DETAILED_ERRORS: true
CI: true
CONFIGURATION: Release
run: |
chmod +x ./build.sh
./build.sh Publish