-
Notifications
You must be signed in to change notification settings - Fork 19
82 lines (71 loc) · 2.85 KB
/
release-and-publish.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Build the tools, create zip-file, create a tag
# and release, and publish to Chocolatey.
# MANUAL TRIGGERED WORKFLOW
name: Release & Publish
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
# Checkout sources. Depth=0 is for using GitVersion
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
# Install and Setup GitVersion
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
# Step id is used as reference for the output values
- name: Use GitVersion to determine the version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
# Build the tools & create the zip-file and nuget packages
# Chocolatey tools are in .\tools. NuGet packages in .\artifacts
- name: Build & Package
run: pwsh .\build.ps1
# Create the CHANGELOG for this release
# We'll compile it from last the version
# to the current commit
#- name: Build Changelog
# id: github_release
# uses: mikepenz/release-changelog-builder-action@v1
# with:
# configuration: "./changelog-config.json"
# fromTag: ${{ steps.gitversion.outputs.VersionSourceSha }}
# toTag: ${{ steps.gitversion.outputs.Sha }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Create GitHub release with created zip-file and CHANGELOG for Chocolatey and releases
# NOTE: this is where we prepend "v" before the version in the tag/release
#- name: Create release
# uses: ncipollo/release-action@v1
# with:
# skipIfReleaseExists: true
# artifacts: "./tools.zip"
# body: ${{steps.github_release.outputs.changelog}}
# tag: "v${{ steps.gitversion.outputs.MajorMinorPatch }}"
# token: ${{ secrets.GITHUB_TOKEN }}
# package and publish Chocolatey package for this version
# We publish the nuspec file which references the tools.zip in releases.
#- name: Publish to Chocolatey
# env:
# CHOCO_TOKEN: ${{ secrets.CHOCO_TOKEN }}
# run: pwsh .\pack.ps1 -publish -version ${{ steps.gitversion.outputs.MajorMinorPatch }}
# Publish all NuGet packages to NuGet.org
# Use --skip-duplicate to prevent errors if a package with the same version already exists.
# If you retry a failed workflow, already published packages will be skipped without error.
- name: Publish separate tools to NuGet
run: |
Get-ChildItem
# foreach($file in (Get-ChildItem "./artifacts" -Recurse -Include *.nupkg)) {
# dotnet nuget push $file --api-key "${{ secrets.NUGET_TOOLS }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
# }