Skip to content

Commit e4cd3de

Browse files
committed
add git release workflow
1 parent 9686b73 commit e4cd3de

File tree

4 files changed

+45
-27
lines changed

4 files changed

+45
-27
lines changed

.github/workflows/git-release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Git Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "[0-9]+.[0-9]+.[0-9]+"
7+
workflow_dispatch:
8+
9+
jobs:
10+
Git_Release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Download Build Artifact
15+
uses: dawidd6/[email protected]
16+
with:
17+
workflow: preview-and-release.yml
18+
workflow_conclusion: success
19+
branch: dev
20+
event: push
21+
name: drop
22+
- name: Github Release
23+
uses: anton-yurchenko/[email protected]
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
26+
DRAFT_RELEASE: "false"
27+
PRE_RELEASE: "false"
28+
CHANGELOG_FILE: "CHANGELOG.md"
29+
ALLOW_EMPTY_CHANGELOG: "true"
30+
with:
31+
args: |
32+
drop/**

.github/workflows/gradle-build.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3-
41
name: Java CI with Gradle
52

63
on:

.github/workflows/preview-and-release.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3-
41
name: Maven Preview/Release and Github Release
52

63
on:
@@ -96,25 +93,18 @@ jobs:
9693
gradle.properties
9794
**/gradle/**
9895
Scripts/**
99-
100-
github_Release:
96+
97+
create_Tag:
10198
needs: maven_Release
102-
runs-on: ubuntu-latest
99+
runs-on: windows-latest
100+
env:
101+
RELEASE_TAG: ""
103102
steps:
104103
- uses: actions/checkout@v2
105-
- name: Download Build Artifact
106-
uses: actions/[email protected]
107-
with:
108-
name: drop
109-
path: drop
110-
- name: Github Release
111-
uses: anton-yurchenko/[email protected]
112-
env:
113-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
114-
DRAFT_RELEASE: "false"
115-
PRE_RELEASE: "false"
116-
CHANGELOG_FILE: "CHANGELOG.md"
117-
ALLOW_EMPTY_CHANGELOG: "true"
104+
- name: Get Version
105+
run: .\Scripts\getLatestVersion.ps1
106+
shell: pwsh
107+
- name: Create tag
108+
uses: rickstaa/[email protected]
118109
with:
119-
args: |
120-
drop/**
110+
tag: ${{ env.RELEASE_TAG }}

Scripts/getLatestVersion.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@ $minorVersion = $findVersions[1].Substring($versionIndex+2)
2727
$patchVersion = $findVersions[2].Substring($versionIndex+2)
2828
$version = "$majorVersion.$minorVersion.$patchVersion"
2929

30-
#Update the VERSION_STRING env variable and inform the user
31-
Write-Host "##vso[task.setVariable variable=VERSION_STRING]$($version)";
32-
Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"
30+
#Set Enviornment variable for use to create tag
31+
echo "RELEASE_TAG=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append

0 commit comments

Comments
 (0)