-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.66 KB
/
dotnet-prerelease-pack.yaml
File metadata and controls
56 lines (48 loc) · 1.66 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
name: Package Pre-Release
run-name: Pack & Publish pre-release NuGet packages
on:
workflow_dispatch:
inputs:
version_suffix:
description: "Version suffix"
type: choice
default: "alpha"
options:
- "alpha"
- "beta"
- "rc"
version_custom:
description: "Custom version suffix or version suffix index"
type: string
required: true
default: "1"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
setup_env:
name: Setup environment
runs-on: ubuntu-latest
outputs:
version_suffix: ${{ steps.set_version_suffix.outputs.version_suffix }}
push_package_to_nuget: ${{ steps.set_version_suffix.outputs.set_push_package_to_nuget }}
steps:
- name: sets env var version_suffix
id: set_version_suffix
run: echo "version_suffix=${{ format('{0}{1}', github.event.inputs.version_suffix, github.event.inputs.version_custom) }}" >> "$GITHUB_OUTPUT"
- name: sets env var push_package_to_nuget
id: set_push_package_to_nuget
run: echo "push_package_to_nuget=${{ startsWith(github.ref_name, 'prerelease/') }}" >> "$GITHUB_OUTPUT"
build_and_test:
name: Build and test
uses: ./.github/workflows/wf-build-test.yaml
publish_nuget:
needs: [build_and_test, setup_env]
name: Publish NuGet packages
uses: ./.github/workflows/wf-publish-nuget.yaml
permissions:
packages: write
with:
push_package_to_nuget: ${{ needs.setup_env.outputs.push_package_to_nuget == 'true' }}
version_suffix: ${{ needs.setup_env.outputs.version_suffix }}
secrets: inherit