Skip to content

Commit 9ab4487

Browse files
committed
ci: add publish task
1 parent 7566a75 commit 9ab4487

1 file changed

Lines changed: 27 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
name: CI (Build & Test)
1+
name: rollbar-gradle-plugin CI
22

33
on:
44
pull_request:
55
push:
66
branches:
7-
- "**" # or restrict to `main` if you prefer
7+
- "**"
8+
release:
9+
types: [published]
810

911
jobs:
1012
test:
@@ -14,7 +16,7 @@ jobs:
1416
- name: Checkout code
1517
uses: actions/checkout@v4
1618

17-
- name: Set up JDK
19+
- name: Set up JDK 17
1820
uses: actions/setup-java@v4
1921
with:
2022
distribution: temurin
@@ -31,3 +33,25 @@ jobs:
3133

3234
- name: Run tests
3335
run: ./gradlew test --stacktrace
36+
37+
publish:
38+
name: Publish to Gradle Plugin Portal
39+
#if: github.event_name == 'release'
40+
runs-on: ubuntu-latest
41+
needs: [ test ]
42+
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v4
46+
47+
- name: Set up JDK 17
48+
uses: actions/setup-java@v4
49+
with:
50+
distribution: temurin
51+
java-version: 17
52+
53+
- name: Publish plugin
54+
run: ./gradlew publishPlugins --stacktrace
55+
env:
56+
ORG_GRADLE_PROJECT_gradlePublishKey: ${{ secrets.GRADLE_PUBLISH_KEY }}
57+
ORG_GRADLE_PROJECT_gradlePublishSecret: ${{ secrets.GRADLE_PUBLISH_SECRET }}

0 commit comments

Comments
 (0)