-
Notifications
You must be signed in to change notification settings - Fork 4
55 lines (45 loc) · 1.55 KB
/
tool.yml
File metadata and controls
55 lines (45 loc) · 1.55 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
---
name: tool
on:
push:
branches:
- main
tags:
- '*'
pull_request:
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Should Deploy?
if: ${{ success() && github.event_name == 'push' }}
shell: pwsh
run: |
if ("${{github.ref}}" -match "^refs/tags/([0-9]+\.[0-9]+\.[0-9]+)")
{
$version = $Matches[1]
echo "UNITY_XREF_MAPS_DEPLOY=1" >> $env:GITHUB_ENV
echo "UNITY_XREF_MAPS_VERSION=$version" >> $env:GITHUB_ENV
}
- name: Pack
if: ${{ success() && env.UNITY_XREF_MAPS_DEPLOY != 1 }}
run: dotnet pack UnityXrefMaps/UnityXrefMaps.csproj -c Release -o ${{ runner.temp }}
- name: Pack (Release)
if: ${{ success() && env.UNITY_XREF_MAPS_DEPLOY == 1 }}
run: dotnet pack UnityXrefMaps/UnityXrefMaps.csproj -c Release -p:PackageVersion=$UNITY_XREF_MAPS_VERSION -o ${{ runner.temp }}
- name: NuGet login
if: ${{ success() && env.UNITY_XREF_MAPS_DEPLOY == 1 }}
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}
- name: Publish (Release)
if: ${{ success() && env.UNITY_XREF_MAPS_DEPLOY == 1 }}
run: |
dotnet nuget push ${{ runner.temp }}/UnityXrefMaps.${{ env.UNITY_XREF_MAPS_VERSION }}.nupkg \
--source https://api.nuget.org/v3/index.json \
--api-key ${{ steps.login.outputs.NUGET_API_KEY }}