-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (49 loc) · 1.56 KB
/
release.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
58
name: Deploy to production (Nugets)
on:
workflow_dispatch:
inputs:
publish_nuget:
description: "Publish Devolutions.XTS.NET"
required: true
type: boolean
publish_dry_run:
description: "Dry Run Mode"
required: true
type: boolean
jobs:
deploy:
runs-on: ubuntu-latest
environment: publish
steps:
- uses: actions/checkout@v4
- name: Check out devolutions/actions
uses: actions/checkout@v4
with:
path: ./.github/workflows
ref: v1
repository: Devolutions/actions
token: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
- name: Install toolbox
uses: ./.github/workflows/toolbox-install
with:
github_token: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
- name: Download Nugets Artifact
run: dv github download-artifact nugets . XTS.NET
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI: true
- name: Extract Artifacts
run: 7z x nugets.zip -o./nugets
- name: Publish NuGet
if: ${{ inputs.publish_nuget }}
run: |
COMMAND="dotnet nuget push ./nugets/Devolutions.XTS.NET.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json"
if [ '${{ inputs.publish_dry_run }}' == 'true' ]; then
echo "Dry Run : True"
else
echo "Dry Run : False"
fi
echo "Running : $COMMAND"
if [ "${{ inputs.publish_dry_run }}" != "true" ]; then # if not dry run, actually run the command
eval "$COMMAND"
fi