fix #2
This file contains hidden or 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: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: write | |
| actions: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Build Plugin | |
| run: mvn clean package | |
| - name: Get short commit hash | |
| id: vars | |
| run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - name: Upload build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: TuffX_${{ steps.vars.outputs.hash }} | |
| path: target/TuffX.jar | |
| - name: Create Release | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.vars.outputs.hash }} | |
| name: Release ${{ steps.vars.outputs.hash }} | |
| files: target/TuffX.jar | |
| prerelease: true | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |