-
Notifications
You must be signed in to change notification settings - Fork 19
53 lines (43 loc) · 1.29 KB
/
pack.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
name: Build and Publish NuGet on Tag
on:
push:
tags:
- '*'
jobs:
build-and-publish:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.*'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Extract tag name
id: get_version
run: echo "##[set-output name=tag;]$(echo ${GITHUB_REF#refs/tags/})"
shell: bash
- name: Pack
run: dotnet pack TiktokenSharp/TiktokenSharp.csproj --configuration Release /p:VersionPrefix=${{ steps.get_version.outputs.tag }} --no-build -o nupkgs
- name: Determine Pre-release Status
id: prerelease
run: |
$ref = "${{ github.ref }}"
if ($ref -like "*alpha*") {
echo "##[set-output name=status;]true"
} else {
echo "##[set-output name=status;]false"
}
shell: powershell
- name: Publish to GitHub Releases
uses: softprops/action-gh-release@v1
with:
files: nupkgs/*.nupkg
prerelease: ${{ steps.prerelease.outputs.status }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}