.gitea/workflows/test-release.yml aktualisiert
This commit is contained in:
parent
b05e054bd7
commit
1e4bbe5d55
@ -1,65 +1,65 @@
|
|||||||
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:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
# Repository auschecken
|
||||||
uses: actions/checkout@v2
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- 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
|
# Projekt bauen
|
||||||
run: apt-get install --reinstall ca-certificates -y
|
- name: Build with Maven
|
||||||
|
run: mvn clean package
|
||||||
|
|
||||||
- name: Install Maven
|
# Artefakt hochladen
|
||||||
run: apt install maven -y
|
- name: Upload Artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: BetterMinecraft-stable.jar
|
||||||
|
path: target/BetterMinecraft-stable.jar
|
||||||
|
|
||||||
- name: Build with Maven
|
# Letzte Release-Version abrufen
|
||||||
run: mvn clean install
|
- name: Get last release version
|
||||||
|
id: get_version
|
||||||
- name: Upload Artifact
|
run: |
|
||||||
uses: actions/upload-artifact@v3
|
echo "VERSION=$(git describe --tags --abbrev=0 || echo '0.0.0')" >> $GITHUB_ENV
|
||||||
with:
|
|
||||||
name: BetterMinecraft-stable.jar
|
|
||||||
path: target/BetterMinecraft-stable.jar
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repository
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Get letzte Release-Version
|
# Version inkrementieren
|
||||||
id: get_version
|
- name: Increment version
|
||||||
run: echo "::set-output name=version::$(git describe --tags --abbrev=0 || echo '0.0.0')"
|
id: increment_version
|
||||||
|
run: |
|
||||||
|
IFS='.' read -ra VERSION <<< "$VERSION"
|
||||||
|
MAJOR=${VERSION[0]:-0}
|
||||||
|
MINOR=${VERSION[1]:-0}
|
||||||
|
PATCH=${VERSION[2]:-0}
|
||||||
|
PATCH=$((PATCH + 1))
|
||||||
|
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
|
||||||
|
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Incrementiere Version
|
# Release erstellen
|
||||||
id: increment_version
|
- name: Create Release
|
||||||
run: |
|
uses: softprops/action-gh-release@v1
|
||||||
IFS='.' read -ra VERSION <<< "${{ steps.get_version.outputs.version }}"
|
with:
|
||||||
MAJOR="${VERSION[0]}"
|
files: target/BetterMinecraft-stable.jar
|
||||||
MINOR="${VERSION[1]}"
|
tag_name: ${{ env.NEW_VERSION }}
|
||||||
PATCH="${VERSION[2]}"
|
release_name: Release ${{ env.NEW_VERSION }}
|
||||||
echo "::set-output name=major::$(($MAJOR + 1))"
|
draft: false
|
||||||
echo "::set-output name=minor::$(($MINOR + 1))"
|
prerelease: true
|
||||||
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
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user