Skip to content

Commit 4d8609d

Browse files
committed
Add github-gradle plugin and use publishGithub task in build workflow
1 parent c207d14 commit 4d8609d

2 files changed

Lines changed: 30 additions & 13 deletions

File tree

.github/workflows/build.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1-
name: Build And Upload
2-
on:
3-
push:
4-
tags:
5-
- "*"
6-
jobs:
7-
call-reusable-workflow:
8-
uses: intisy/workflows/.github/workflows/build.yml@main
9-
with:
10-
ref_name: ${{ github.ref_name }}
11-
secrets:
12-
envPAT: ${{ secrets.PAT }}
1+
name: Build And Upload
2+
on:
3+
push:
4+
tags:
5+
- "*"
6+
permissions:
7+
contents: write
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout project sources
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Gradle
16+
uses: gradle/gradle-build-action@v3
17+
18+
- name: Grant execute permission for gradlew
19+
run: chmod +x gradlew
20+
21+
- name: Publish GitHub Release
22+
run: ./gradlew publishGithub -Partifact_version=${{ github.ref_name }}
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.PAT }}

build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
id "java"
33
id "com.github.johnrengelman.shadow" version "8.1.1"
44
id "io.github.intisy.online-gradle" version "1.7.2"
5+
id "io.github.intisy.github-gradle" version "1.7.3"
56
}
67

78
online {
@@ -14,6 +15,10 @@ online {
1415
]
1516
}
1617

18+
github {
19+
accessToken = System.getenv("GITHUB_TOKEN") ?: ""
20+
}
21+
1722
repositories {
1823
mavenLocal()
1924
mavenCentral()
@@ -34,4 +39,4 @@ dependencies {
3439
implementation "org.kohsuke:github-api:1.324"
3540
implementation "com.github.codemonstur:embedded-redis:1.4.3"
3641
testImplementation "junit:junit:4.12"
37-
}
42+
}

0 commit comments

Comments
 (0)