Skip to content

Update maven.yml - autorelease #6

Update maven.yml - autorelease

Update maven.yml - autorelease #6

Workflow file for this run

name: Java CI with Maven and Release
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
# Zapisz zbudowany artefakt
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: minecraft-plugin
path: target/*.jar # Zakładając, że plik .jar jest w katalogu target
# Opcjonalnie, jeśli chcesz automatycznie tworzyć release'y tylko przy pushach na mastera, możesz dodać kolejny job
release:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: minecraft-plugin
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: 'minecraft-plugin/*.jar'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}