Merge pull request #4 from MajdT51/develop #6
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
name: Build Plugin | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: "17" | |
distribution: "temurin" | |
- name: Extract version from pom.xml | |
id: get_version | |
run: echo "PLUGIN_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
- name: Build with Maven | |
run: mvn install | |
- name: Upload plugin jar with version | |
if: github.event_name == 'push' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: diamondGuarantee-${{ env.PLUGIN_VERSION }} | |
path: target/diamondGuarantee-${{ env.PLUGIN_VERSION }}.jar | |
- name: Inform Discord | |
if: github.event_name == 'push' | |
uses: sarisia/actions-status-discord@v1 | |
with: | |
webhook: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
username: GitHub Actions | |
avatar-url: https://avatars.githubusercontent.com/u/44036562 | |
title: Plugin Build | |
description: Plugin build has been completed. | |
color: 3066993 | |
status: ${{ job.status }} | |
fields: version=${{ env.PLUGIN_VERSION }} |