14 Commits

2 changed files with 43 additions and 51 deletions

View File

@ -1,65 +1,56 @@
name: Build and Release Minecraft Plugin name: Build and Release Minecraft Plugin
on: on:
merge: push:
branches: branches:
- testing - testing
jobs: jobs:
build: build-and-release:
steps: steps:
- name: Checkout Repository # Repository auschecken
uses: actions/checkout@v2 - name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Java 17 # Java 17 installieren
uses: actions/setup-java@v2 - name: Set up Java 17
with: uses: actions/setup-java@v3
java-version: '17' with:
distribution: 'adopt' # Verwenden Sie 'adopt' für Java 17 java-version: '17'
distribution: 'temurin'
- name: Update Apt # Maven installieren und vorbereiten
run: apt update -y - name: Install Maven
run: |
sudo apt-get update
sudo apt-get install -y maven
- name: Update CA certificates # Plugin-Version aus plugin.yml auslesen
run: apt-get install --reinstall ca-certificates -y - name: Extract Plugin Version
id: extract_version
run: |
VERSION=$(grep '^version:' src/main/resources/plugin.yml | awk '{print $2}')
echo "PLUGIN_VERSION=$VERSION" >> $GITHUB_ENV
shell: bash
- name: Install Maven # Projekt mit Maven bauen
run: apt install maven -y - name: Build with Maven
run: mvn clean package
- name: Build with Maven # Artefakt hochladen
run: mvn clean install - name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: BetterMinecraft-${{ env.PLUGIN_VERSION }}-b.jar
path: target/BetterMinecraft-${{ env.PLUGIN_VERSION }}-b.jar
- name: Upload Artifact # Release erstellen
uses: actions/upload-artifact@v3 - name: Create Release
with: uses: softprops/action-gh-release@v1
name: BetterMinecraft-stable.jar with:
path: target/BetterMinecraft-stable.jar files: target/BetterMinecraft-stable.jar
steps: tag_name: ${{ env.PLUGIN_VERSION }}
- name: Checkout Repository release_name: Release ${{ env.PLUGIN_VERSION }}
uses: actions/checkout@v2 draft: false
prerelease: true
- name: Get letzte Release-Version
id: get_version
run: echo "::set-output name=version::$(git describe --tags --abbrev=0 || echo '0.0.0')"
- name: Incrementiere Version
id: increment_version
run: |
IFS='.' read -ra VERSION <<< "${{ steps.get_version.outputs.version }}"
MAJOR="${VERSION[0]}"
MINOR="${VERSION[1]}"
PATCH="${VERSION[2]}"
echo "::set-output name=major::$(($MAJOR + 1))"
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-beta.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: true

1
.gitea/workflows/test.md Normal file
View File

@ -0,0 +1 @@
testtest