Skip to content

Commit 4c18b3f

Browse files
Use instanseg actions
1 parent 97d0f61 commit 4c18b3f

File tree

6 files changed

+90
-82
lines changed

6 files changed

+90
-82
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,41 @@
1-
name: Publish snapshot to SciJava Maven
1+
name: Run gradle build
22

3-
on:
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- "main"
410
workflow_dispatch:
11+
workflow_call:
512

6-
jobs:
7-
publish:
13+
permissions:
14+
contents: read
815

16+
jobs:
17+
build:
918
runs-on: ubuntu-latest
1019

1120
steps:
21+
1222
- uses: actions/checkout@v4
23+
1324
- name: Set up JDK 21
14-
uses: actions/setup-java@v3
25+
uses: actions/setup-java@v4
1526
with:
1627
java-version: '21'
1728
distribution: 'temurin'
29+
1830
- name: Setup Gradle
1931
uses: gradle/actions/setup-gradle@v4
20-
- name: Publish snapshot
21-
run: ./gradlew publish
22-
env:
23-
MAVEN_USER: ${{ secrets.MAVEN_USER }}
24-
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
32+
33+
- name: Build with Gradle
34+
run: |
35+
./gradlew build
36+
2537
- uses: actions/upload-artifact@v4
2638
with:
27-
name: jar
28-
path: build/libs
39+
path: build/libs/*.jar
40+
name: build
2941
retention-days: 7

.github/workflows/gradle.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/maven.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish to SciJava Maven
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
release:
7+
required: false
8+
type: boolean
9+
default: false
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-java@v4
18+
with:
19+
java-version: '21'
20+
distribution: 'temurin'
21+
22+
- name: Setup Gradle
23+
uses: gradle/actions/setup-gradle@v4
24+
25+
- name: Add release flag if input variable is set
26+
if: ${{ inputs.release }}
27+
shell: bash
28+
run: |
29+
echo "RELEASE_FLAG='-Prelease'" >> $GITHUB_ENV
30+
31+
- name: Publish
32+
shell: bash
33+
run: |
34+
./gradlew publish -P toolchain=21 $RELEASE_FLAG
35+
env:
36+
MAVEN_USER: ${{ secrets.MAVEN_USER }}
37+
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
38+
39+
- uses: actions/upload-artifact@v4
40+
if: ${{ inputs.release }}
41+
with:
42+
name: ${{ github.event.repository.name }}-release-jar
43+
path: build/libs
44+
retention-days: 7
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Publish release to SciJava Maven
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
name: Publish release
9+
uses: ./.github/workflows/maven.yml
10+
secrets: inherit
11+
with:
12+
release: true
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Publish snapshot to SciJava Maven
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
name: Publish snapshot
9+
uses: ./.github/workflows/maven.yml
10+
secrets: inherit

.github/workflows/publish-release.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)