Skip to content

Commit 8c8f810

Browse files
authored
Add release automation (#6)
Signed-off-by: jorgee <[email protected]>
1 parent d4e730a commit 8c8f810

File tree

4 files changed

+40
-1
lines changed

4 files changed

+40
-1
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ name: Gradle Build
22

33
on:
44
push:
5+
branches:
6+
- 'master'
57
pull_request:
8+
types: [opened, reopened, synchronize]
9+
workflow_dispatch:
610

711
jobs:
812
build:

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on:
2+
workflow_dispatch:
3+
4+
push:
5+
branches: [ main ]
6+
paths: [ VERSION ]
7+
8+
jobs:
9+
release:
10+
if: "contains(github.event.head_commit.message, '[release]')"
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up JDK 17
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: '17'
20+
distribution: 'temurin'
21+
22+
- name: Publish Plugin
23+
env:
24+
GRADLE_PUBLISH_KEY: ${{ vars.GRADLE_PUBLISH_KEY }}
25+
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
26+
run: ./gradlew publishPlugins --no-daemon --stacktrace
27+
28+
- name: Create Git Tag
29+
run: |
30+
git config user.name "${GITHUB_ACTOR}"
31+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
32+
VERSION=$(cat VERSION)
33+
git tag -a v$VERSION -m "Release v$VERSION"
34+
git push origin v$VERSION

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.1-alpha7

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
group = 'io.nextflow'
9-
version = '0.0.1-alpha6'
9+
version = file('VERSION').text.trim()
1010

1111
repositories {
1212
mavenCentral()

0 commit comments

Comments
 (0)