diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..86f9cf5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,86 @@ +name: Java CI + +on: + push: + tags: + - 'v*' + + +jobs: + build: + name: 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: 'adopt' + cache: maven + + - name: Get project version + uses: avides/actions-project-version-check@v1.4.0 + id: actions_project_version_check + with: + token: ${{ secrets.GITHUB_TOKEN }} + file-to-check: plugin/pom.xml + only-return-version: true + + - name: Display version (debug) + run: echo "New version is:" ${{ steps.actions_project_version_check.outputs.version }} + + - name: Build with Maven + run: | + mvn -B package --file ./plugin/pom.xml + mkdir staging && cp plugin/target/original-*.jar "staging/MagicznaKraina-v$Project_Version.jar" + env: + Project_Version: ${{ steps.actions_project_version_check.outputs.version }} + + - name: Upload jar file as .zip + uses: actions/upload-artifact@v3 + with: + name: MagicznaKraina-v${{ steps.actions_project_version_check.outputs.version }} + path: staging/**.jar + if-no-files-found: error + + release: + needs: [build] + runs-on: ubuntu-latest + name: 🚀 release + permissions: + contents: write + steps: + - name: 📚 checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Get project version + uses: avides/actions-project-version-check@v1.4.0 + id: actions_project_version_check + with: + token: ${{ secrets.GITHUB_TOKEN }} + file-to-check: plugin/pom.xml + only-return-version: true + + - name: Download artifact + uses: actions/download-artifact@master + with: + name: MagicznaKraina-v${{ steps.actions_project_version_check.outputs.version }} + path: downloads + + - name: Display structure of downloaded files + run: ls -R + working-directory: downloads + + - name: create release + uses: ncipollo/release-action@v1 + with: + generateReleaseNotes: true + bodyFile: 'changelog-release.md' + artifacts: downloads/MagicznaKraina-v${{ steps.actions_project_version_check.outputs.version }}.jar + + diff --git a/README.md b/README.md index 601bb31..449ee6e 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ This plugin adds new mobs and functionality to the game, making it more challeng | Name | Value | |-------------------|--------------| -| Java version | 18 | -| Minecraft version | 1.19.4 | +| Java version | 17 | +| Minecraft version | 1.20 | | IDE | InteliJ IDEA | ## Errors, suggestions diff --git a/changelog-release.md b/changelog-release.md new file mode 100644 index 0000000..8a80203 --- /dev/null +++ b/changelog-release.md @@ -0,0 +1 @@ +## Changelog