Skip to content

Commit f023b77

Browse files
committed
setup git-release workflow
1 parent 02f9e6a commit f023b77

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/action-download-artifact@v2.14.1
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/git-release@v4.1
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 and Github Release
52

63
on:
@@ -65,25 +62,18 @@ jobs:
6562
gradle.properties
6663
**/gradle/**
6764
Scripts/**
68-
69-
github_Release:
65+
66+
create_Tag:
7067
needs: maven_Preview
71-
runs-on: ubuntu-latest
68+
runs-on: windows-latest
69+
env:
70+
RELEASE_TAG: ""
7271
steps:
7372
- uses: actions/checkout@v2
74-
- name: Download Build Artifact
75-
uses: actions/download-artifact@v2.0.10
76-
with:
77-
name: drop
78-
path: drop
79-
- name: Github Release
80-
uses: anton-yurchenko/git-release@v4.1
81-
env:
82-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
83-
DRAFT_RELEASE: "false"
84-
PRE_RELEASE: "false"
85-
CHANGELOG_FILE: "CHANGELOG.md"
86-
ALLOW_EMPTY_CHANGELOG: "true"
73+
- name: Get Version
74+
run: .\Scripts\getLatestVersion.ps1
75+
shell: pwsh
76+
- name: Create tag
77+
uses: rickstaa/action-create-tag@v1.2.0
8778
with:
88-
args: |
89-
drop/**
79+
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)