-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish the new data type plugin jar file.
- Loading branch information
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# publish-plugin.yml | ||
|
||
name: build and publish plugin | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
tags: | ||
- 'v*.*.*' # publish new version for tag which follows 'v*.*.*' format | ||
|
||
env: | ||
SERVICE_NAME: ecp-plugin | ||
|
||
jobs: | ||
verification: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout local repository | ||
uses: actions/checkout@v3 | ||
with: | ||
path: ${{ github.workspace }}/${{ env.SERVICE_NAME }} | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'gradle' | ||
- name: Run all tests | ||
run: ./gradlew clean check --no-daemon | ||
working-directory: ${{ github.workspace }}/${{ env.SERVICE_NAME }}/ | ||
|
||
determine_should_publish_new_version: # Publish new version for new tags | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
PUBLISH_NEW_VERSION: ${{ steps.determine_should_publish_new_version.outputs.PUBLISH_NEW_VERSION }} | ||
steps: | ||
- name: Checkout local repository | ||
uses: actions/checkout@v3 | ||
- name: Determine should publish docker image | ||
id: determine_should_publish_new_version | ||
run: | | ||
PUBLISH_NEW_VERSION=false | ||
if [[ $(git tag --points-at HEAD) != '' ]]; then | ||
PUBLISH_NEW_VERSION=true | ||
fi | ||
echo "PUBLISH_NEW_VERSION=${PUBLISH_NEW_VERSION}" >> $GITHUB_OUTPUT | ||
publish-jar: | ||
runs-on: ubuntu-22.04 | ||
needs: [ determine_should_publish_new_version, verification ] | ||
if: ${{ needs.determine_should_publish_new_version.outputs.PUBLISH_NEW_VERSION == 'true' }} | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout local repository | ||
uses: actions/checkout@v3 | ||
with: | ||
path: ${{ github.workspace }}/${{ env.SERVICE_NAME }} | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'gradle' | ||
- name: Publish jar | ||
run: ./gradlew publish --no-daemon | ||
working-directory: ${{ github.workspace }}/${{ env.SERVICE_NAME }}/ | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |