Skip to content

Commit

Permalink
Merge pull request #14 from sonomirco/develop
Browse files Browse the repository at this point in the history
Publish new official release
  • Loading branch information
sonomirco authored Jul 27, 2021
2 parents 87edad0 + cd63935 commit 915974e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .github/workflows/publish-alpha-release.yml
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
1 change: 0 additions & 1 deletion .github/workflows/publish-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ jobs:
dotnet-version: 3.1.x
- name: Set env
run: echo "NUGET_VERSION=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV
- run: dotnet build -c release -p:Version=${{ env.NUGET_VERSION }}

0 comments on commit 915974e

Please sign in to comment.