-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from sonomirco/develop
Publish new official release
- Loading branch information
Showing
2 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Tag and Publish Alpha | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
build-bump-alpha-publish: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout repo. | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 3.1.x | ||
- name: Get previous tag. | ||
id: version | ||
run: | | ||
lastTag=`git tag -l --sort=-creatordate --format='%(refname:short)' | head -n 1` | ||
echo "::set-output name=tag::$lastTag" | ||
- name: Bump if alpha. | ||
id: bump-with-alpha | ||
uses: actions/github-script@v3 | ||
with: | ||
result-encoding: string | ||
script: | | ||
const incoming = "${{steps.version.outputs.tag}}" | ||
console.log("Incoming Tag: " + incoming) | ||
if(incoming.includes('alpha')) { | ||
const oldNum = incoming.match(/alpha[.]*(\d+)/)[1] | ||
const newNum = parseInt(oldNum)+1 | ||
const newTag = incoming.replace(/alpha.*\d+/, `alpha.${newNum}`) | ||
console.log("New Tag: " + newTag) | ||
return newTag | ||
} | ||
else { | ||
const splitLast = incoming.match(/(.*\.)(\d*)/) | ||
const newTag =splitLast[1] + (parseInt(splitLast[2])+1)+'-alpha.0' | ||
console.log("New Tag: " + newTag) | ||
return newTag | ||
} | ||
- name: Set NuGet version from alpha. | ||
run: echo "NUGET_VERSION=${{steps.bump-with-alpha.outputs.result}}" >> $GITHUB_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters