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

chore: Upgrade github actions and use standard gradle actions #192

Merged
merged 1 commit into from
Apr 11, 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
84 changes: 42 additions & 42 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
name: build-main

on:
push:
branches:
- main
- release/*
paths-ignore:
- 'doc/**'
- '*.md'
push:
branches:
- main
- release/*
paths-ignore:
- 'doc/**'
- '*.md'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3

- name: Run tests
run: ./gradlew check

- name: Bundle the build report
if: failure()
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip

- name: Upload the build report
if: failure()
uses: actions/upload-artifact@v3
with:
name: error-report
path: build-reports.zip

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3

- name: deploy to sonatype snapshots
run: ./gradlew publish
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}

env:
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/gradle-build-action@v3

- name: Run tests
run: ./gradlew check

- name: Bundle the build report
if: failure()
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip
- name: Upload the build report
if: failure()
uses: actions/upload-artifact@v3
with:
name: error-report
path: build-reports.zip

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/gradle-build-action@v3

- name: deploy to sonatype snapshots
run: ./gradlew publish
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}
45 changes: 22 additions & 23 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
name: build-pr

on:
pull_request:
paths-ignore:
- 'doc/**'
- '*.md'
pull_request:
paths-ignore:
- 'doc/**'
- '*.md'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/gradle-build-action@v3

- name: Run tests
run: ./gradlew check
- name: Run tests
run: ./gradlew check

- name: Bundle the build report
if: failure()
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip
- name: Bundle the build report
if: failure()
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip

- name: Upload the build report
if: failure()
uses: actions/upload-artifact@v3
with:
name: error-report
path: build-reports.zip

env:
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
- name: Upload the build report
if: failure()
uses: actions/upload-artifact@v3
with:
name: error-report
path: build-reports.zip
51 changes: 25 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
name: release

on:
workflow_dispatch:
inputs:
version:
description: "The release version (e.g., '1.9.0')."
required: true
workflow_dispatch:
inputs:
version:
description: "The release version (e.g., '1.9.0')."
required: true

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/gradle-build-action@v3

- name: publish release
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
RELEASE_VERSION: ${{ github.event.inputs.version }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
- name: create release
run: gh release create "v${RELEASE_VERSION}" --generate-notes
env:
RELEASE_VERSION: ${{ github.event.inputs.version }}
GH_TOKEN: ${{ github.token }}

env:
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
- name: publish release
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
RELEASE_VERSION: ${{ github.event.inputs.version }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
- name: create release
run: gh release create "v${RELEASE_VERSION}" --generate-notes
env:
RELEASE_VERSION: ${{ github.event.inputs.version }}
GH_TOKEN: ${{ github.token }}