forked from ForNeVeR/TruePath
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (61 loc) · 2.55 KB
/
release.yml
File metadata and controls
62 lines (61 loc) · 2.55 KB
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
60
61
62
# SPDX-FileCopyrightText: 2024-2026 TruePath contributors <https://github.com/ForNeVeR/TruePath>
#
# SPDX-License-Identifier: MIT
# This file is auto-generated.
name: Release
on:
push:
branches:
- main
- renovate/**
tags:
- v*
pull_request:
branches:
- main
schedule:
- cron: 0 0 * * 6
workflow_dispatch:
jobs:
nuget:
permissions:
contents: write
runs-on: ubuntu-24.04
steps:
- name: Check out the sources
uses: actions/checkout@v6
- id: version
name: Get version
shell: pwsh
run: echo "version=$(scripts/Get-Version.ps1 -RefName $env:GITHUB_REF)" >> $env:GITHUB_OUTPUT
- run: dotnet pack --configuration Release -p:Version=${{ steps.version.outputs.version }}
- name: Read changelog
uses: ForNeVeR/ChangelogAutomation.action@v2
with:
output: ./release-notes.md
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
path: |-
./release-notes.md
./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.nupkg
./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.snupkg
./TruePath.SystemIo/bin/Release/TruePath.SystemIo.${{ steps.version.outputs.version }}.nupkg
./TruePath.SystemIo/bin/Release/TruePath.SystemIo.${{ steps.version.outputs.version }}.snupkg
- if: startsWith(github.ref, 'refs/tags/v')
name: Create a release
uses: softprops/action-gh-release@v2
with:
body_path: ./release-notes.md
files: |-
./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.nupkg
./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.snupkg
./TruePath.SystemIo/bin/Release/TruePath.SystemIo.${{ steps.version.outputs.version }}.nupkg
./TruePath.SystemIo/bin/Release/TruePath.SystemIo.${{ steps.version.outputs.version }}.snupkg
name: TruePath v${{ steps.version.outputs.version }}
- if: startsWith(github.ref, 'refs/tags/v')
name: Push TruePath to NuGet
run: dotnet nuget push ./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN_TRUE_PATH }}
- if: startsWith(github.ref, 'refs/tags/v')
name: Push TruePath.SystemIo to NuGet
run: dotnet nuget push ./TruePath.SystemIo/bin/Release/TruePath.SystemIo.${{ steps.version.outputs.version }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN_TRUE_PATH_SYSTEM_IO }}