Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #4

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Merge branch

on:
workflow_dispatch:
inputs:
host_branch:
description: Host branch with you changes to merge on `target_branch`.
required: true
target_branch:
description: Target branch to merge/copy from `host_branch`.
required: true

jobs:
execute:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure Git
run: |
git config --global user.email "Github Actions"
git config --global user.name "[email protected]"

- name: Validate
run: |
if [[ "${{ github.event.inputs.target_branch }}" != "alpha" && "${{ github.event.inputs.target_branch }}" != "dev" && "${{ github.event.inputs.target_branch }}" != "main" ]]; then
echo "Error: Target branch must be 'alpha' or 'dev' or 'main'."
exit 1
fi

- name: Merge
run: |
git checkout ${{ github.event.inputs.target_branch }}
git merge ${{ github.event.inputs.host_branch }} --no-edit
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/Runkang10/UniversalMCAPI.git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- name: Checkout
Expand Down
32 changes: 31 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: Test
on:
push:
branches:
- "**"
- main
- dev
- alpha
pull_request:
branches:
- "**"
Expand Down Expand Up @@ -36,3 +38,31 @@ jobs:

- name: Run tests
run: ./gradlew test --no-daemon

build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}

- name: Set up SDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21

- run: chmod +x ./gradlew

- name: Run tests
run: ./gradlew build --no-daemon
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,5 @@ runs/

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

.kotlin/*