Skip to content

Commit

Permalink
Alpha (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Runkang10 authored Oct 24, 2024
2 parents ab77faf + d30af87 commit 29475ad
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 2 deletions.
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/*

0 comments on commit 29475ad

Please sign in to comment.