Skip to content

Commit

Permalink
Merge pull request #20 from grails/gh-workflow
Browse files Browse the repository at this point in the history
Update GitHub Workflow Configurations
  • Loading branch information
puneetbehl authored Nov 23, 2023
2 parents 96a9816 + 33826a9 commit 497c7f1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 35 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,18 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['11']
env:
GIT_USER_NAME: puneetbehl
GIT_USER_EMAIL: behlp@objectcomputing.com
GIT_USER_EMAIL: behlp@unityfoundation.io
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
java-version: 11
distribution: 'adopt'
- name: Publish Documentation
uses: gradle/gradle-build-action@v2
Expand Down
46 changes: 17 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ on:
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['11']
permissions:
contents: write
env:
BETA: ${{ contains(github.event.inputs.gorm_version, 'M') || contains(github.event.inputs.gorm_version, 'RC') }}
BETA: ${{ contains(github.event.inputs.gorm_version, 'M') }}
GIT_USER_NAME: puneetbehl
GIT_USER_EMAIL: behlp@objectcomputing.com
GIT_USER_EMAIL: behlp@unityfoundation.io
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -24,7 +23,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
java-version: 11
- name: Extract branch name
if: success() && github.event_name == 'workflow_dispatch'
id: extract_branch
Expand All @@ -39,17 +38,6 @@ jobs:
if_false: ${{ env.PATH_PREFIX }}-${{ github.event.inputs.gorm_version }}.zip
env:
PATH_PREFIX: "./build/distributions/gorm-docs"
- name: Create Release
if: success() && github.event_name == 'workflow_dispatch'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.gorm_version }}
release_name: ${{ github.event.inputs.gorm_version }}
draft: false
prerelease: ${{ env.BETA }}
- name: Run pre-release
if: success() && github.event_name == 'workflow_dispatch'
uses: grails/github-actions/pre-release@main
Expand All @@ -67,18 +55,18 @@ jobs:
TAGGED_VERSION: v${{ github.event.inputs.gorm_version }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
- name: Upload Release Asset
if: success() && github.event_name == 'workflow_dispatch'
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
- name: Create Release With Assets
uses: ncipollo/release-action@v1
if: success()
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.asset_path.outputs.value }}
asset_name: gorm-docs.zip
asset_content_type: application/zip
tag: v${{ github.event.inputs.gorm_version }}
name: ${{ github.event.inputs.gorm_version }}
prerelease: ${{ env.BETA }}
artifacts: "${{ steps.asset_path.outputs.value }}"
artifactContentType: application/zip
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Determine docs target repository
if: success()
uses: haya14busa/action-cond@v1
Expand All @@ -101,7 +89,7 @@ jobs:
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
- name: Run post-release
if: success()
uses: grails/github-actions/post-release@main
uses: grails/github-actions/post-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
env:
Expand Down

0 comments on commit 497c7f1

Please sign in to comment.