Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce tag pr #4

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,38 @@ name: Publish

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

branches:
- main
jobs:
publish:
tagpr:
permissions:
actions: write
contents: write
pull-requests: write
runs-on: ubuntu-latest

outputs:
tag: ${{ steps.run-tagpr.outputs.tag }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: Songmu/tagpr@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
needs: tagpr
if: needs.tagpr.outputs.tag != '' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8

- name: Test
run: ./gradlew test
env:
OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }}

- name: Publish
run: ./gradlew build publish --no-parallel
run: ./gradlew publishAllPublicationsToMavenCentralRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ allprojects {
plugins.withId("com.vanniktech.maven.publish") {
mavenPublishing {
// Want to publish to so1.oss.sonatype.org
publishToMavenCentral(SonatypeHost.S01,true)
publishToMavenCentral(SonatypeHost.S01, true)
signAllPublications()
}
}
Expand Down
Loading