forked from WaterdogPE/WaterdogPE
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # pom.xml # src/main/java/dev/waterdog/waterdogpe/command/Command.java # src/main/java/dev/waterdog/waterdogpe/command/defaults/SendCommand.java # src/main/java/dev/waterdog/waterdogpe/command/defaults/ServerCommand.java # src/main/java/dev/waterdog/waterdogpe/network/protocol/ProtocolConstants.java # src/main/java/dev/waterdog/waterdogpe/network/protocol/ProtocolVersion.java # src/main/java/dev/waterdog/waterdogpe/network/protocol/codec/BedrockCodec448.java # src/main/java/dev/waterdog/waterdogpe/network/protocol/user/HandshakeUtils.java
- Loading branch information
Showing
239 changed files
with
7,208 additions
and
5,912 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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: "build" | ||
description: "Default WDPE build action" | ||
|
||
inputs: | ||
repo_token: | ||
description: "GitHub secret token" | ||
required: true | ||
perform_deploy: | ||
description: "Whether to deploy to maven repository" | ||
required: true | ||
deploy_repository: | ||
description: "The maven repository name to deploy" | ||
required: true | ||
deploy_username: | ||
description: "A username to access maven repository" | ||
required: true | ||
deploy_password: | ||
description: "A password of a maven repository user" | ||
required: true | ||
create_prerelease: | ||
description: "Create a pre release build" | ||
required: true | ||
prerelease_name: | ||
description: "A name of pre-release" | ||
required: false | ||
default: "latest" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up Java 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: adopt-hotspot | ||
|
||
- name: Setup maven repo | ||
uses: s4u/[email protected] | ||
if: ${{ inputs.perform_deploy == 'true' }} | ||
with: | ||
servers: | | ||
[{ | ||
"id": "${{ inputs.deploy_repository }}", | ||
"username": "${{ inputs.deploy_username }}", | ||
"password": "${{ inputs.deploy_password }}" | ||
}] | ||
- name: Build | ||
if: ${{ inputs.perform_deploy == 'false' }} | ||
run: mvn -B package --file pom.xml | ||
shell: bash | ||
|
||
- name: Build and Deploy | ||
if: ${{ inputs.perform_deploy == 'true' }} | ||
run: mvn -B package deploy --file pom.xml | ||
shell: bash | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: waterdog | ||
path: target/Waterdog.jar | ||
|
||
- name: Create pre-release | ||
if: ${{ inputs.create_prerelease == 'true' }} | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ inputs.repo_token }}" | ||
automatic_release_tag: "${{ inputs.prerelease_name }}" | ||
prerelease: true | ||
title: "Snapshot Build" | ||
files: | | ||
target/Waterdog.jar |
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,47 +1,59 @@ | ||
# This workflow will build a Java project with Maven | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
name: Build and Publish | ||
|
||
name: Maven Build | ||
|
||
on: [ push ] | ||
on: | ||
workflow_dispatch: | ||
push: | ||
tags-ignore: | ||
- '**' | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
build: | ||
env: | ||
DOCKER_DEPLOY: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/waterdog-2' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Java 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: adopt-hotspot | ||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: waterdog | ||
path: target/Waterdog.jar | ||
- name: Upload pre-release | ||
if: github.ref == 'refs/heads/master' | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build | ||
uses: ./.github/actions/build | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "latest" | ||
prerelease: true | ||
title: "Snapshot Build" | ||
files: | | ||
target/Waterdog.jar | ||
- name: Login to DockerHub | ||
if: github.ref == 'refs/heads/master' | ||
uses: docker/login-action@v2 | ||
perform_deploy: ${{ env.DOCKER_DEPLOY }} | ||
deploy_repository: "waterdog-snapshots" | ||
deploy_username: ${{ secrets.DEPLOY_USERNAME }} | ||
deploy_password: ${{ secrets.DEPLOY_PASSWORD }} | ||
create_prerelease: ${{ github.ref == 'refs/heads/master' }} | ||
prerelease_name: "latest" | ||
|
||
- name: Docker Login | ||
uses: docker/login-action@v1 | ||
if: ${{ env.DOCKER_DEPLOY == 'true' }} | ||
with: | ||
registry: "ghcr.io" | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
if: ${{ env.DOCKER_DEPLOY == 'true' }} | ||
with: | ||
username: waterdogpe | ||
password: ${{ secrets.docker_pat }} | ||
- name: Publish Docker latest | ||
if: github.ref == 'refs/heads/master' | ||
uses: docker/[email protected] | ||
images: "ghcr.io/${{ github.repository }}" | ||
tags: | | ||
type=ref,event=branch | ||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} | ||
- name: Docker build and push | ||
uses: docker/build-push-action@v4 | ||
if: ${{ env.DOCKER_DEPLOY == 'true' && github.event_name != 'pull_request' }} | ||
with: | ||
context: ./ | ||
push: true | ||
tags: waterdogpe/waterdogpe:latest | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,17 @@ | ||
name: Pull Request Check | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build and verify | ||
uses: ./.github/actions/build | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
perform_deploy: false | ||
create_prerelease: false |
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,4 +1,4 @@ | ||
name: Release build | ||
name: Release Build | ||
on: | ||
push: | ||
tags: | ||
|
@@ -7,34 +7,52 @@ jobs: | |
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Startup | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Java 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: adopt-hotspot | ||
- name: Build with Maven | ||
|
||
- name: Set version to release | ||
run: | | ||
sed -i -e s/#build/"release"/g ./src/main/java/dev/waterdog/waterdogpe/VersionInfo.java | ||
mvn -B install --file pom.xml | ||
- name: Create Release | ||
- name: Build | ||
uses: ./.github/actions/build | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
perform_deploy: true | ||
deploy_repository: "waterdog-releases" | ||
deploy_username: ${{ secrets.DEPLOY_USERNAME }} | ||
deploy_password: ${{ secrets.DEPLOY_PASSWORD }} | ||
create_prerelease: false # Use custom release step | ||
|
||
- name: Create release | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: false | ||
title: "Release ${{ github.ref }} by ${{ github.actor }}" | ||
files: | | ||
target/Waterdog.jar | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
- name: Docker Login | ||
uses: docker/login-action@v1 | ||
with: | ||
username: waterdogpe | ||
password: ${{ secrets.docker_pat }} | ||
- name: Publish Docker release | ||
uses: docker/[email protected] | ||
registry: "ghcr.io" | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
context: ./ | ||
push: true | ||
tags: waterdogpe/waterdogpe:release,waterdogpe/waterdogpe:${{ github.ref }} | ||
images: "ghcr.io/${{ github.repository }}" | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=raw,value=release | ||
- name: Docker build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.