-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.58 KB
/
publish-compat.yml
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
name: Publish (Chasm.Compatibility.*)
run-name: Publish ${{ inputs.project }}
permissions:
packages: write
on:
workflow_dispatch:
inputs:
project:
description: The project to publish
required: true
type: choice
options:
- Chasm.Compatibility
- Chasm.Compatibility.Attributes
- Chasm.Compatibility.IndexRange
- Chasm.Compatibility.ValueTuple
- Chasm.Compatibility.HashCode
- Chasm.Compatibility.Unsafe
jobs:
publish-package:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
- name: Install dependencies
run: dotnet restore
- name: Compile ${{ inputs.project }}
run: |
mkdir __out
dotnet pack Chasm.Compatibility/${{ inputs.project }} -c Release -o __out -p:WorkflowPublishingPackage=true --no-restore
- name: Publish ${{ inputs.project }} to NuGet
run: |
dotnet nuget push "./__out/*.nupkg" --skip-duplicate -n \
-s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
- name: Publish ${{ inputs.project }} to GitHub
run: |
dotnet nuget push "./__out/*.nupkg" --skip-duplicate -n \
-s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json -k ${{ secrets.GITHUB_TOKEN }}
- name: Remove temporary files
run: |
rm -rf __out