Compare commits
No commits in common. "main" and "1.0" have entirely different histories.
@ -3,58 +3,63 @@ name: Build and Release Minecraft Plugin
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- Resting
|
- release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-release:
|
build:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Repository auschecken
|
- name: Checkout Repository
|
||||||
- name: Checkout Repository
|
uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# Java 17 installieren
|
- name: Set up Java 17
|
||||||
- name: Set up Java 17
|
uses: actions/setup-java@v2
|
||||||
uses: actions/setup-java@v3
|
with:
|
||||||
with:
|
java-version: '17'
|
||||||
java-version: '17'
|
distribution: 'adopt' # Verwenden Sie 'adopt' für Java 17
|
||||||
distribution: 'temurin'
|
|
||||||
|
|
||||||
# Maven installieren
|
- name: Update Apt
|
||||||
- name: Install Maven
|
run: apt update -y
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y maven
|
|
||||||
|
|
||||||
# Plugin-Version aus plugin.yml auslesen
|
- name: Update CA certificates
|
||||||
- name: Extract Plugin Version
|
run: apt-get install --reinstall ca-certificates -y
|
||||||
id: extract_version
|
|
||||||
run: |
|
|
||||||
VERSION=$(grep '^version:' src/main/resources/plugin.yml | awk '{print $2}')
|
|
||||||
echo "PLUGIN_VERSION=$VERSION" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# Projekt mit Maven bauen
|
- name: Install Maven
|
||||||
- name: Build with Maven
|
run: apt install maven -y
|
||||||
run: mvn clean package
|
|
||||||
|
|
||||||
# JAR-Datei umbenennen
|
- name: Build with Maven
|
||||||
- name: Rename JAR File
|
run: mvn clean install
|
||||||
run: |
|
|
||||||
mv target/*.jar target/BetterMinecraft-${{ env.PLUGIN_VERSION }}-b.jar
|
- name: Upload Artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: BetterMinecraft-stable.jar
|
||||||
|
path: target/BetterMinecraft-stable.jar
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
# Artefakt hochladen
|
- name: Get letzte Release-Version
|
||||||
- name: Upload Artifact
|
id: get_version
|
||||||
uses: actions/upload-artifact@v3
|
run: echo "::set-output name=version::$(git describe --tags --abbrev=0 || echo '0.0.0')"
|
||||||
with:
|
|
||||||
name: BetterMinecraft-${{ env.PLUGIN_VERSION }}-b.jar
|
|
||||||
path: target/BetterMinecraft-${{ env.PLUGIN_VERSION }}-b.jar
|
|
||||||
|
|
||||||
# Release erstellen
|
- name: Incrementiere Version
|
||||||
- name: Create Release
|
id: increment_version
|
||||||
uses: softprops/action-gh-release@v1
|
run: |
|
||||||
with:
|
IFS='.' read -ra VERSION <<< "${{ steps.get_version.outputs.version }}"
|
||||||
files: target/BetterMinecraft-${{ env.PLUGIN_VERSION }}-b.jar
|
MAJOR="${VERSION[0]}"
|
||||||
tag_name: ${{ env.PLUGIN_VERSION }}
|
MINOR="${VERSION[1]}"
|
||||||
release_name: Release ${{ env.PLUGIN_VERSION }}
|
PATCH="${VERSION[2]}"
|
||||||
draft: false
|
echo "::set-output name=major::$(($MAJOR + 1))"
|
||||||
prerelease: false
|
echo "::set-output name=minor::$(($MINOR + 1))"
|
||||||
|
echo "::set-output name=patch::$(($PATCH + 1))"
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
target/BetterMinecraft-stable.jar
|
||||||
|
tag_name: ${{ steps.increment_version.outputs.major }}.${{ steps.increment_version.outputs.minor }}.${{ steps.increment_version.outputs.patch }}
|
||||||
|
release_name: Release ${{ steps.increment_version.outputs.major }}.${{ steps.increment_version.outputs.minor }}.${{ steps.increment_version.outputs.patch }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
@ -3,11 +3,11 @@ name: Build and Release Minecraft Plugin
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- Testing
|
- testing
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-release:
|
build-and-release:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Repository auschecken
|
# Repository auschecken
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
@ -20,7 +20,7 @@ jobs:
|
|||||||
java-version: '17'
|
java-version: '17'
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
|
|
||||||
# Maven installieren
|
# Maven installieren und vorbereiten
|
||||||
- name: Install Maven
|
- name: Install Maven
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
@ -32,16 +32,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
VERSION=$(grep '^version:' src/main/resources/plugin.yml | awk '{print $2}')
|
VERSION=$(grep '^version:' src/main/resources/plugin.yml | awk '{print $2}')
|
||||||
echo "PLUGIN_VERSION=$VERSION" >> $GITHUB_ENV
|
echo "PLUGIN_VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
|
||||||
# Projekt mit Maven bauen
|
# Projekt mit Maven bauen
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn clean package
|
run: mvn clean package
|
||||||
|
|
||||||
# JAR-Datei umbenennen
|
|
||||||
- name: Rename JAR File
|
|
||||||
run: |
|
|
||||||
mv target/*.jar target/BetterMinecraft-${{ env.PLUGIN_VERSION }}-b.jar
|
|
||||||
|
|
||||||
# Artefakt hochladen
|
# Artefakt hochladen
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
@ -53,7 +49,7 @@ jobs:
|
|||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
files: target/BetterMinecraft-${{ env.PLUGIN_VERSION }}-b.jar
|
files: target/BetterMinecraft-stable.jar
|
||||||
tag_name: ${{ env.PLUGIN_VERSION }}
|
tag_name: ${{ env.PLUGIN_VERSION }}
|
||||||
release_name: Release ${{ env.PLUGIN_VERSION }}
|
release_name: Release ${{ env.PLUGIN_VERSION }}
|
||||||
draft: false
|
draft: false
|
@ -1 +1 @@
|
|||||||
testtesttesttrest
|
testtest
|
Loading…
x
Reference in New Issue
Block a user