Skip to content

Commit

Permalink
Update Github Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetbehl committed Dec 18, 2021
1 parent c8c89f0 commit faa2af9
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 55 deletions.
36 changes: 20 additions & 16 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
name-template: $NEXT_PATCH_VERSION
tag-template: v$NEXT_PATCH_VERSION
version-resolver:
major:
labels:
- 'type: major'
minor:
labels:
- 'type: minor'
patch:
labels:
- 'type: patch'
default: patch
name-template: $RESOLVED_VERSION
tag-template: v$RESOLVED_VERSION
categories:
- title: 🚀 Features
- title: Features
labels:
- "type: enhancement"
- "type: new feature"
- "type: major"
- title: 🚀 Bug Fixes/Improvements
- title: 🐛 Bug Fixes/Improvements
labels:
- "type: improvement"
- "type: bug"
Expand All @@ -26,9 +15,24 @@ categories:
labels:
- "type: dependency upgrade"
- "dependencies"
- title: ⚙️ Build/CI
labels:
- "type: ci"
- "type: build"
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
version-resolver:
major:
labels:
- 'type: major'
minor:
labels:
- 'type: minor'
patch:
labels:
- 'type: patch'
default: patch
template: |
## Changes
## What's Changed
$CHANGES
Expand Down
43 changes: 23 additions & 20 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ name: Java CI
on:
push:
branches:
- main
- 4.0.x
- '[4-9]+.[0-9]+.x'
pull_request:
branches:
- main
- 4.0.x
- '[4-9]+.[0-9]+.x'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -19,38 +18,42 @@ jobs:
GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Run Tests
run: |
(set -x; ./gradlew clean check --no-daemon)
if: github.event_name == 'pull_request'
id: tests
uses: gradle/gradle-build-action@v2
with:
arguments: check -Dgeb.env=chromeHeadless
- name: Run Build
if: github.event_name == 'push'
id: build
uses: gradle/gradle-build-action@v2
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
with:
arguments: build -Dgeb.env=chromeHeadless
- name: Publish Test Report
if: failure()
if: steps.build.outcome == 'failure' || steps.tests.outcome == 'failure'
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Run Assemble
if: success() && github.event_name == 'push' && matrix.java == '8'
run: ./gradlew assemble
- name: Publish to repo.grails.org
if: success() && github.event_name == 'push' && matrix.java == '8'
id: publish
uses: gradle/gradle-build-action@v2
if: steps.build.outcome == 'success' && github.event_name == 'push' && matrix.java == '8'
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: |
./gradlew publish
with:
arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish
- name: Publish to Github Pages
if: success() && github.event_name == 'push' && matrix.java == '8'
if: steps.publish.outcome == 'success' && github.event_name == 'push' && matrix.java == '8'
uses: micronaut-projects/github-pages-deploy-action@master
env:
TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }}
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
types: [closed,reopened]
push:
branches:
- main
- 4.0.x
- '[4-9]+.[0-9]+.x'
workflow_dispatch:
jobs:
release_notes:
Expand All @@ -17,15 +16,17 @@ jobs:
run: |
has_release_drafter=$([ -f .github/release-drafter.yml ] && echo "true" || echo "false")
echo ::set-output name=has_release_drafter::${has_release_drafter}
- name: Extract branch name
id: extract_branch
run: echo ::set-output name=value::${GITHUB_REF:11}
# If it has release drafter:
- uses: release-drafter/release-drafter@v5.15.0
- uses: release-drafter/release-drafter@v5
if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
prerelease: false
commitish: main
commitish: ${{ steps.extract_branch.outputs.value }}
filter-by-commitish: true
# Otherwise:
- name: Export Gradle Properties
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
Expand Down
28 changes: 15 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,39 @@ jobs:
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Extract Target Branch
id: extract_branch
run: |
echo "Determining Target Branch"
TARGET_BRANCH=`cat $GITHUB_EVENT_PATH | jq '.release.target_commitish' | sed -e 's/^"\(.*\)"$/\1/g'`
echo $TARGET_BRANCH
echo ::set-output name=value::${TARGET_BRANCH}
- name: Set the current release version
id: release_version
run: echo ::set-output name=release_version::${GITHUB_REF:11}
- name: Run pre-release
uses: micronaut-projects/github-actions/pre-release@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate secring file
env:
SECRING_FILE: ${{ secrets.SECRING_FILE }}
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
- name: Publish to Sonatype OSSRH
id: publish
uses: gradle/gradle-build-action@v2
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SECRING_FILE: ${{ secrets.SECRING_FILE }}
run: |
echo $SECRING_FILE | base64 -d > secring.gpg
echo "Publishing Artifacts"
(set -x; ./gradlew -Psigning.secretKeyRingFile="${GITHUB_WORKSPACE}/secring.gpg" publishToSonatype closeAndReleaseSonatypeStagingRepository --no-daemon)
(set -x; ./gradlew assemble --no-daemon)
with:
arguments: -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishToSonatype closeAndReleaseSonatypeStagingRepository
- name: Run Assemble
id: assemble
if: steps.publish.outcome == 'success'
uses: gradle/gradle-build-action@v2
with:
arguments: assemble
- name: Export Gradle Properties
uses: micronaut-projects/github-actions/export-gradle-properties@master
- name: Publish to Github Pages
if: success()
if: steps.assemble.outcome == 'success'
uses: micronaut-projects/github-pages-deploy-action@master
env:
BETA: ${{ contains(steps.release_version.outputs.release_version, 'M') || contains(steps.release_version.outputs.release_version, 'RC') }}
Expand Down

0 comments on commit faa2af9

Please sign in to comment.