Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/MineValley/Core-API into ne…
Browse files Browse the repository at this point in the history
…w-chars
  • Loading branch information
Snabeldier committed Jan 15, 2024
2 parents bb9b422 + 167785e commit 297ec88
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 28 deletions.
58 changes: 40 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,53 @@
name: Core-API | Maven-deployer

# This workflow is used to deploy a new maven-build of this api, whenever a new release is created.
# Always make sure to delete the latest package before creating a new release!
name: Core-API | Build and deploy

on:
release: # Triggers this workflow whenever a new release is created.
types: [published]
workflow_call:
inputs:
version:
description: 'The version of the new build.'
required: true
type: string
isRelease:
description: 'Is this a release build?'
required: true
type: boolean

permissions:
contents: write
packages: write


jobs:
build:
runs-on: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- name: Repository-Checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v4

# Sets the current Java-version to 1.8.
- name: Set up to JDK 1.8
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 1.8.0
distribution: 'temurin'
cache: 'maven'
java-version: 8

# Deploys a maven-build as a new package to be accessed with any pom.xml.
- name: Deploy to GitHub
run: |
mvn source:jar
mvn deploy
- name: Set Project Version
run: mvn versions:set -DnewVersion=${{ inputs.version }}

- name: Build with Maven
run: mvn -B clean package

- name: Deploy to GitHub Packages # Repository is set in pom.xml
run: mvn deploy
env:
GITHUB_TOKEN: ${{ secrets.DEPLOY_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload assets to release
if: ${{ inputs.isRelease }}
uses: softprops/[email protected]
with:
files: |
target/api-${{ inputs.version }}.jar
target/api-${{ inputs.version }}-sources.jar
target/api-${{ inputs.version }}-javadoc.jar
47 changes: 47 additions & 0 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Core-API | Nightly Builder

on:
push:
branches:
- '**'

workflow_dispatch:

jobs:
get-latest-version:
name: Get latest version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version-ready.outputs.release }}
steps:
- name: Get latest release version
if: github.event_name == 'push'
id: get-latest-version
uses: pozetroninc/[email protected]
with:
repository: ${{ github.repository }}

- name: Increment version
if: github.event_name == 'push'
id: increment-version
run: |
RELEASE_NAME=${{ steps.get-latest-version.outputs.release }}
echo "release=$(echo ${RELEASE_NAME#v} | awk -F. -v OFS=. '{$NF = $NF + 1;} 1')" >> "$GITHUB_OUTPUT"
- name: Set output
id: version-ready

run: |
if [[ "${{ github.ref_name}}" == "main" || "${{ github.ref_name }}" == "master" ]]; then
echo "release=${{ steps.increment-version.outputs.release }}" >> "$GITHUB_OUTPUT"
else
echo "release=${{ github.ref_name }}_${{ steps.increment-version.outputs.release }}" >> "$GITHUB_OUTPUT"
fi
build-nightly:
name: Build Nightly version
needs: get-latest-version
uses: ./.github/workflows/build.yml
with:
version: ${{ needs.get-latest-version.outputs.version }}-SNAPSHOT
isRelease: false
26 changes: 26 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Core-API | Release Builder

on:
release:
types: [published]

jobs:
get-version:
name: Get Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Get Version
id: get-version
run: |
TAG_NAME=${{ github.event.release.tag_name }}
echo "version=${TAG_NAME#v}" >> "$GITHUB_OUTPUT"
build-release:
name: Build Release
needs: get-version
uses: ./.github/workflows/build.yml
with:
version: ${{ needs.get-version.outputs.version }}
isRelease: true
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
# ![Logo](https://cdn.minevalley.eu/branding/logo_64px_cropped.png) - Core API
This api grants important features and access to the internal server-core of MineValleyEU, that is used in any module.

This README.md is intended to help you with your daily issues or questions referring to our core and its components. It should offer you the most important information and give you answers to your upcoming questions. If this isn't the case sometimes, feel free to contact us on Discord.

We do our best to update this documentary. There's no other source of information, that is more up-to-date, than this one. If there is any missing information or mistake in this README or if you should have any suggestions, please create a new issue, thank you!
The wiki to this api is still work in progress.

> **Core API**:
>
> version: _1.278_
> version: _1.278.1_
>
> latest change: _07.01.2024_

### Documentation
There will be comprehensive documentation in the "Wiki" tab
> latest change: _12.01.2024_
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>minevalley.core</groupId>
<artifactId>api</artifactId>
<version>1.278</version>
<version>1.278.1</version>
<packaging>jar</packaging>

<build>
Expand All @@ -32,10 +32,15 @@
<id>github</id>
<name>GitHub MineValley Apache Maven Packages</name>
<url>https://maven.pkg.github.com/MineValley/Core-API</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</distributionManagement>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<smart-api.version>1.60</smart-api.version>

<maven.compiler.source>8</maven.compiler.source>
Expand Down

0 comments on commit 297ec88

Please sign in to comment.