-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (57 loc) · 1.73 KB
/
Copy pathpublish-artifacts.yml
File metadata and controls
67 lines (57 loc) · 1.73 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
63
64
65
66
67
name: Publish Artifacts
on:
workflow_call:
inputs:
package_version:
description: "Optional package version, usually the release tag without the leading v."
required: false
type: string
permissions:
contents: read
jobs:
package:
name: Pack packages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Restore
run: dotnet restore ModularityKit.Mutator.slnx
- name: Resolve package version
id: version
env:
PACKAGE_VERSION: ${{ inputs.package_version }}
REF_NAME: ${{ github.ref_name }}
run: |
version="$PACKAGE_VERSION"
if [ -z "$version" ]; then
version="$REF_NAME"
fi
version="${version#v}"
if ! printf '%s' "$version" | grep -Eq '^[0-9]+(\.[0-9]+){1,2}([-+][0-9A-Za-z.-]+)?$'; then
version="0.1.0"
fi
echo "package_version=$version" >> "$GITHUB_OUTPUT"
- name: Pack core package
run: >
dotnet pack src/ModularityKit.Mutator.csproj
-c Release
--no-restore
-o nupkg
-p:PackageVersion=${{ steps.version.outputs.package_version }}
- name: Pack governance package
run: >
dotnet pack src/ModularityKit.Mutator.Governance.csproj
-c Release
--no-restore
-o nupkg
-p:PackageVersion=${{ steps.version.outputs.package_version }}
- name: Upload packages
uses: actions/upload-artifact@v4
with:
name: ModularityKit-packages
path: nupkg/*.nupkg