Skip to content

Commit d6ad782

Browse files
committed
add actions for releases
1 parent e1164e9 commit d6ad782

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

.github/workflows/master.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Tag git version
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Git tag
14+
run: |
15+
git tag $(cat VERSION)
16+
git push --tags

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Prepare release candidate
2+
3+
on:
4+
push:
5+
branches:
6+
- release/*
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: Set up JDK 1.8
14+
uses: actions/setup-java@v1
15+
with:
16+
java-version: 1.8
17+
- name: Gradle uploadArchives
18+
run: |
19+
./gradlew uploadArchives
20+
env:
21+
IS_RELEASE: "YES"
22+
PGP_KEY: ${{ secrets.PGP_KEY }}
23+
PGP_PSW: ${{ secrets.PGP_PSW }}
24+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
25+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.0-SNAPSHOT
1+
1.2.0

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ plugins {
77
id 'org.unbroken-dome.test-sets' version '3.0.1'
88
}
99

10+
def isRelease = System.getenv('IS_RELEASE') == 'YES'
11+
1012
group = 'net.twasi'
11-
version = rootProject.file('VERSION').text.trim()
13+
version = rootProject.file('VERSION').text.trim() + isRelease ? '' : '-SNAPSHOT'
1214
archivesBaseName = rootProject.name
1315

1416
java.sourceCompatibility = JavaVersion.VERSION_1_8

0 commit comments

Comments
 (0)