Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

Tag on release builds #35

Merged
merged 1 commit into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,17 @@ jobs:
FEED_API_KEY: ${{ secrets.FEED_API_KEY }}
FEED_SOURCE: ${{ secrets.FEED_SOURCE }}
run: dotnet nuget push artifacts/**/*.nupkg --api-key "$FEED_API_KEY" --source "$FEED_SOURCE"

- name: GitHub Tag 🏷
id: github-tag
uses: actions/github-script@v3
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' && github.event_name != 'schedule' && steps.build.outputs.prerelease_tag == ''
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.build.outputs.semver }}",
sha: context.sha
})
5 changes: 5 additions & 0 deletions build/Build.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Linq;
using Nuke.Common;
using Nuke.Common.CI;
Expand Down Expand Up @@ -81,6 +82,10 @@ class Build : NukeBuild
.Executes(() =>
{
Logger.Info("Packing AzureDevOps issue tracker v{0}", OctoVersionInfo.FullSemVer);

// This is done to pass the data to github actions
Console.Out.WriteLine($"::set-output name=semver::{OctoVersionInfo.FullSemVer}");
Console.Out.WriteLine($"::set-output name=prerelease_tag::{OctoVersionInfo.PreReleaseTagWithDash}");

DotNetPack(_ => _
.SetProject(Solution)
Expand Down