Skip to content

Commit

Permalink
👷: add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
junerver committed Dec 10, 2024
1 parent 3405c8f commit bfe5b68
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build & Test & Publish

on:
workflow_dispatch:

env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

jobs:

publish-hooks:
runs-on: macos-latest
timeout-minutes: 60

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v3

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Cache Build Tooling
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}

- name: Build All
run: ./gradlew :hooks:assemble

- name: Gradle Cache
uses: gradle/gradle-build-action@v2

- name: Publish to MavenCentral
run: ./gradlew :hooks:publishAndReleaseToMavenCentral

0 comments on commit bfe5b68

Please sign in to comment.