-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (35 loc) · 1.45 KB
/
release.yaml
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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get version from input
id: tag_name
shell: pwsh
env:
INPUT_VERSION: ${{ github.event.inputs.version }}
run: |
$current_version = $env:INPUT_VERSION.StartsWith('v') ? $env:INPUT_VERSION.Substring(1) : $env:INPUT_VERSION
echo "current_version=$current_version" >> $env:GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Print Debug Info
run: dotnet --info
- name: Restore dependencies
run: dotnet restore
- name: Pack
# https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#packrelease
env:
DOTNET_CLI_ENABLE_PACK_RELEASE_FOR_SOLUTIONS: true
run: dotnet pack -c Release --no-restore -p:Version="${{ steps.tag_name.outputs.current_version }}" -p:RepositoryBranch=${{ github.ref_name }} -p:RepositoryCommit="${{ github.sha }}"
- name: Push to NuGet
run: dotnet nuget push **/*.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
- name: Push to GitHub Packages
run: dotnet nuget push **/*.nupkg --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/erri120/index.json