forked from MineValley/CoreAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* improve building Signed-off-by: Valentin Sickert <[email protected]> * start test Signed-off-by: Valentin Sickert <[email protected]> * add checkout Signed-off-by: Valentin Sickert <[email protected]> * set api version Signed-off-by: Valentin Sickert <[email protected]> * remove dynamic version Signed-off-by: Valentin Sickert <[email protected]> * set correct version via comment Signed-off-by: Valentin Sickert <[email protected]> * update workflow because `::set-output` is deprecated Signed-off-by: Valentin Sickert <[email protected]> * test empty dispatch Signed-off-by: Valentin Sickert <[email protected]> --------- Signed-off-by: Valentin Sickert <[email protected]>
- Loading branch information
Showing
4 changed files
with
88 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,39 @@ | ||
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. | ||
type: [published] | ||
workflow_call: | ||
inputs: | ||
version: | ||
description: 'The version of the new build.' | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
contents: read | ||
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 | ||
|
||
- name: Set Project Version | ||
run: mvn versions:set -DnewVersion=${{ inputs.version }} | ||
|
||
- name: Build with Maven | ||
run: mvn source:jar | ||
|
||
# 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: 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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Core-API | Nightly Builder | ||
|
||
on: | ||
push: | ||
branches: | ||
- testing | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
get-version: | ||
name: Get version | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.set-version-push.outputs.version || steps.set-version.outputs.version }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set short commit hash on push | ||
if: github.event_name == 'push' | ||
id: set-version-push | ||
run: echo "version=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" | ||
- name: Set version from input | ||
if: github.event_name == 'workflow_dispatch' | ||
id: set-version | ||
run: echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT" | ||
|
||
build-nightly: | ||
name: Build Nightly version | ||
needs: get-version | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
version: ${{ needs.get-version.outputs.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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 }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters