Skip to content

Commit

Permalink
CI update
Browse files Browse the repository at this point in the history
  • Loading branch information
Becods committed Feb 8, 2024
1 parent 30be076 commit 0d6ce1c
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 12 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@ name: Java CI

on:
push:
tags:
- 'v*'
branches:
- 'v*'
pull_request:
tags:
- 'v*'
branches:
- 'v*'
workflow_dispatch:
inputs:
force-update:
Expand All @@ -22,10 +14,6 @@ jobs:
velocity-lib:
runs-on: ubuntu-latest
steps:
- name: Check Ref
run: |
echo "Current ref: ${{ github.ref }}"
- name: Get Velocity Library Cache
if: ${{ ! inputs.force-update }}
uses: actions/cache@v3
Expand Down
92 changes: 92 additions & 0 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Weekly updates

on:
schedule:
- cron: "15 4 * * 6"
workflow_dispatch:

jobs:
velocity-lib:
runs-on: ubuntu-latest
steps:
- name: Get Velocity
uses: actions/checkout@v3
with:
repository: 'PaperMC/Velocity'

- name: Setup JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
cache: 'gradle'

- name: Build Velocity
uses: gradle/gradle-build-action@v2
with:
gradle-version: current
arguments: build

- name: Collection Library
run: |
mkdir -p velocity/libraries
cp api/build/libs/velocity-api-*-SNAPSHOT.jar velocity/libraries
cp proxy/build/libs/velocity-proxy-*-SNAPSHOT.jar velocity/libraries
- name: Cache Velocity Library
uses: actions/cache@v3
with:
path: velocity/libraries
key: ${{ runner.os }}-build-${{ env.cache-name }}}}

build:
needs: velocity-lib
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3

- name: Setup JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
cache: 'gradle'

- name: Get Velocity Library
uses: actions/cache@v3
with:
path: velocity/libraries
key: ${{ runner.os }}-build-${{ env.cache-name }}}}

- name: Patch Gradle Repositories
run:
sed -ni '/https:\/\/maven.aliyun.com\/repository\/public/{h;n;/https:\/\/repo1.maven.org\/maven2/!{:a;N;/https:\/\/maven.aliyun.com\/repository\/public/!ba;x;H;n};x;H;x};p' repositories

- name: Build
uses: gradle/gradle-build-action@v2
with:
gradle-version: current
arguments: ShadowJar

- name: Cleanup Gradle Cache
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
- name: Rename Weekly
run: |
mkdir release
mv bukkit/build/libs/MultiLogin-Bukkit-Build_*.jar release/
mv bungee/build/libs/MultiLogin-Bungee-Build_*.jar release/
mv velocity/build/libs/MultiLogin-Velocity-Build_*.jar release/
- name: Publish Weekly
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "weekly"
draft: false
prerelease: true
title: "MultiLogin Weekly updates"
files: release/*.jar

0 comments on commit 0d6ce1c

Please sign in to comment.