Skip to content

Commit

Permalink
Upgraded Gradle wrapper and lib-guillotine dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
alansemenov committed Sep 29, 2020
1 parent 0781f38 commit 7ec04ea
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 3 deletions.
93 changes: 92 additions & 1 deletion .github/workflows/enonic-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:

runs-on: ubuntu-latest

needs: release_notes

steps:
- uses: actions/[email protected]

Expand All @@ -23,4 +25,93 @@ jobs:
- run: ./gradlew build

- uses: codecov/[email protected]
- uses: codecov/[email protected]

### PUBLISHING STEPS ###

- name: Get publishing variables
id: publish_vars
uses: enonic/release-tools/publish-vars@master
env:
PROPERTIES_PATH: './gradle.properties'
JAVA_HOME: ''

- name: Fail on bad config
if: steps.publish_vars.outputs.version == '' || steps.publish_vars.outputs.projectName == ''
run: exit 1

- name: Publish
if: ${{ github.ref == 'refs/heads/master' }}
run: ./gradlew publish -PrepoKey=${{ steps.publish_vars.outputs.repo }} -PrepoUser=${{ secrets.ARTIFACTORY_USERNAME }} -PrepoPassword=${{ secrets.ARTIFACTORY_PASSWORD }}

- name: Download changelog
if: steps.publish_vars.outputs.release == 'true'
uses: actions/download-artifact@v2
with:
name: changelog

- name: Create Release
if: steps.publish_vars.outputs.release == 'true'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.publish_vars.outputs.tag_name }}
body_path: changelog.md
prerelease: ${{ steps.publish_vars.outputs.prerelease == 'true' }}

- name: Upload Release Asset
id: upload-release-asset
if: "steps.create_release.outputs.upload_url != ''"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "build/libs/${{ steps.publish_vars.outputs.projectName }}-${{ steps.publish_vars.outputs.version }}.jar"
asset_name: "${{ steps.publish_vars.outputs.projectName }}-${{ steps.publish_vars.outputs.version }}.jar"
asset_content_type: application/java-archive

- name: Write new snapshot version
if: steps.publish_vars.outputs.release == 'true'
uses: christian-draeger/[email protected]
with:
path: './gradle.properties'
property: 'version'
value: ${{ steps.publish_vars.outputs.nextSnapshot }}

- name: Commit and push new version
if: steps.publish_vars.outputs.release == 'true'
uses: EndBug/add-and-commit@v4
with:
add: ./gradle.properties
message: 'Updated to next SNAPSHOT version'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release_notes:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0

- name: Get previous release tag
id: get_previous_release_tag
run: |
PREVIOUS_RELEASE_TAG=$(git tag --sort=-version:refname --merged | grep -E '^v([[:digit:]]+\.){2}[[:digit:]]+$' | head -1)
echo ::set-output name=previous_release_tag::$PREVIOUS_RELEASE_TAG
- name: Generate Release Notes
uses: enonic/release-tools/generate-changelog@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ZENHUB_TOKEN: ${{ secrets.ZENHUB_TOKEN }}
PREVIOS_RELEASE_TAG: ${{ steps.get_previous_release_tag.outputs.previous_release_tag }}
OUTPUT_FILE: changelog.md

- uses: actions/upload-artifact@v2
with:
name: changelog
path: changelog.md
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies {
include "com.enonic.xp:lib-content:${xpVersion}"
include "com.enonic.xp:lib-portal:${xpVersion}"
include "com.enonic.xp:lib-websocket:${xpVersion}"
include "com.enonic.lib:lib-guillotine:4.2.0"
include "com.enonic.lib:lib-guillotine:4.2.1"
include "com.enonic.lib:lib-graphql-playground:0.0.1"
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-bin.zip

0 comments on commit 7ec04ea

Please sign in to comment.