This repository was archived by the owner on Aug 12, 2025. It is now read-only.
Bump version to 1.0.1 in plugin.yml #9
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: Release | |
| permissions: | |
| contents: write # Allow the workflow to write to the repository contents | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| workflow_dispatch: | |
| inputs: | |
| firstName: | |
| description: "Your first name" | |
| type: string | |
| default: Brad | |
| required: true | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '23' | |
| distribution: 'temurin' | |
| - name: Cache Gradle | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/gradle-wrapper.properties') }} | |
| restore-keys: gradle-${{ runner.os }}- | |
| - name: Make gradlew executable | |
| run: chmod +x gradlew | |
| - name: Run tests | |
| run: ./gradlew test | |
| - name: Build shadowJar | |
| run: ./gradlew shadowJar | |
| - name: Extract version | |
| id: vars | |
| run: | | |
| echo "version=$(grep -m1 '^version:' src/main/resources/plugin.yml | sed 's/version:[ ]*//')" >> $GITHUB_OUTPUT | |
| - name: Fetch all tags | |
| run: git fetch --tags | |
| - name: Check if tag exists | |
| run: | | |
| TAG=${{ steps.vars.outputs.version }} | |
| if git ls-remote --tags origin "refs/tags/$TAG" | grep -q "$TAG"; then | |
| echo "❌ Tag '$TAG' existiert bereits. Breche ab." | |
| exit 1 | |
| else | |
| echo "✅ Tag '$TAG' ist neu. Fortfahren..." | |
| fi | |
| - name: Find built JAR | |
| id: jar | |
| run: | | |
| JAR_PATH=$(ls build/libs/*.jar | head -n1) | |
| echo "jar_path=$JAR_PATH" >> $GITHUB_OUTPUT | |
| - name: Create Release | |
| id: create | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.vars.outputs.version }} | |
| release_name: ${{ steps.vars.outputs.version }} | |
| draft: false | |
| prerelease: false | |
| - name: Upload JAR | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create.outputs.upload_url }} | |
| asset_path: ${{ steps.jar.outputs.jar_path }} | |
| asset_name: nextcore-${{ steps.vars.outputs.version }}.jar | |
| asset_content_type: application/java-archive |