-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (46 loc) · 1.21 KB
/
Copy pathrelease.yml
File metadata and controls
52 lines (46 loc) · 1.21 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
name: Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g. 1.2.3, without v-prefix).'
required: true
type: string
permissions:
contents: read
jobs:
version:
name: Resolve version
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.resolve.outputs.version }}
steps:
- id: resolve
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#v}"
else
VERSION="${{ inputs.version }}"
fi
if [[ -z "$VERSION" ]]; then
echo "error: empty version" >&2
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Resolved version: $VERSION"
test:
needs: version
uses: ./.github/workflows/reusable-test.yml
pack:
needs: [version, test]
uses: ./.github/workflows/reusable-pack.yml
with:
version: ${{ needs.version.outputs.version }}
publish:
needs: pack
uses: ./.github/workflows/reusable-nuget-publish.yml
secrets:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}