Compare commits

...

15 Commits

Author SHA1 Message Date
ShintoKosei
75266cceed Update CI 2024-04-06 17:44:45 +08:00
Klop233
8a292a655a update CI 2024-04-06 17:26:39 +08:00
Klop233
a0779956f1 update CI 2024-04-06 17:16:17 +08:00
Klop233
1de9ca9d5f update CI 2024-04-06 17:05:59 +08:00
Klop233
bc842c855a update CI 2024-04-06 17:03:35 +08:00
Klop233
120ddafc2f update CI 2024-04-06 16:56:25 +08:00
Klop233
3b1a8cc929 update CI 2024-04-06 16:44:12 +08:00
ShintoKosei
2914a219e2 update ci 2024-04-06 16:32:40 +08:00
ShintoKosei
07bbbd3d7e update ci 2024-04-06 16:21:50 +08:00
Klop233
e69cf4c9ec Update README.md 2024-04-06 16:13:21 +08:00
ShintoKosei
6b679bc02e [ci skip]Update CI 2024-04-06 16:10:40 +08:00
ShintoKosei
124a240fe9 [ci skip]update API.sh 2024-04-06 15:53:49 +08:00
ShintoKosei
e8b9aaee48 [ci skip]change gradle.properties: pre 2024-04-06 15:52:36 +08:00
ShintoKosei
eb3502eb86 [ci skip]Change file name 2024-04-06 15:29:18 +08:00
ShintoKosei
bdd41593e0 [ci skip]Add CI v2 2024-04-06 15:18:39 +08:00
6 changed files with 118 additions and 3 deletions

View File

@@ -9,9 +9,9 @@ name: LuminolCI - Ver/1.20.4
on: on:
push: push:
branches: [ "ver/1.20.4" ] # branches: [ "ver/1.20.4" ]
pull_request: pull_request:
branches: [ "ver/1.20.4" ] # branches: [ "ver/1.20.4" ]
permissions: write-all permissions: write-all
@@ -37,7 +37,7 @@ jobs:
- name: Build project to paperclip jar - name: Build project to paperclip jar
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with: with:
arguments: createReobfPaperclipJar arguments: createReobfBundlerJar createReobfPaperclipJar
- name: Capture build artifacts - name: Capture build artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:

70
.github/workflows/build_1_20_4_v2.yml vendored Normal file
View File

@@ -0,0 +1,70 @@
name: Luminol CI v2 - Ver/1.20.4
on:
push:
branches: [ "ver/1.20.4" ]
pull_request:
branches: [ "ver/1.20.4" ]
# workflow_dispatch:
permissions: write-all
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Git Repository
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Git Config
run: |
git config --global user.email "ci@luminolmc.com"
git config --global user.name "Luminol CI"
- name: Apply Patches
run: ./gradlew applyPatches
- name: Build
run: ./gradlew createReobfBundlerJar createReobfPaperclipJar
- uses: "actions/upload-artifact@v3"
with:
name: "Luminol CI Artifacts"
path: "build/libs/*.jar"
- name: Get version from asset
id: get_version
run: echo "::set-output name=version::$(echo build/libs/*.jar | grep -oP 'bundler-\K\d+\.\d+\.\d+' | head -1)"
- name: Set outputs
id: short_sha
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set env
run: echo "tag=${{ steps.get_version.outputs.version }}-${{ steps.short_sha.outputs.sha_short }}" >> $GITHUB_ENV
- name: Rename jar file
run: |
mv build/libs/luminol-bundler-1.20.4-R0.1-SNAPSHOT-reobf.jar build/libs/luminol-1.20.4-bundler.jar
mv build/libs/luminol-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar build/libs/luminol-1.20.4-paperclip.jar
- name: Get and Set ENV
run: sh scripts/GetSetENV.sh
- name: Create Release
if: "!contains(github.event.commits[0].message, '[release-skip]')"
uses: ncipollo/release-action@v1.12.0
with:
tag: ${{ env.tag }}
name: Luminol ${{ steps.get_version.outputs.version }} - ${{ steps.short_sha.outputs.sha_short }}
body: |
📦Version: `${{ steps.get_version.outputs.version }}` | Commit ${{ steps.short_sha.outputs.sha_short }} [![download](https://img.shields.io/github/downloads/LuminolMC/Luminol/${{ env.tag }}/total?color=0&style=flat-square)](https://github.com/LeavesMC/LuminolMC/Luminol/download/${{ steps.get_version.outputs.version }}-${{ steps.short_sha.outputs.sha_short }}/luminol-1.20.4-paperclip.jar)
This release is automatically compiled by GitHub Actions
artifacts: |
build/libs/luminol-1.20.4-bundler.jar
build/libs/luminol-1.20.4-paperclip.jar
generateReleaseNotes: true
prerelease: ${{ env.pre }}
makeLatest: ${{ env.make_latest }}
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Push to Api
if: "!contains(github.event.commits[0].message, '[release-skip]')"
env:
secret_v2: ${{ secrets.API_V2_PUSH_TOKEN }}
tag: ${{ env.tag }}
run: sh scripts/PushToAPI.sh

View File

@@ -74,3 +74,4 @@ QQ群: [368632360](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=MfosKhcDd8Fdxn1MREu
<img alt="Star历史表" src="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date" /> <img alt="Star历史表" src="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol&type=Date" />
</picture> </picture>
</a> </a>

View File

@@ -7,3 +7,5 @@ org.gradle.caching = true
org.gradle.parallel = true org.gradle.parallel = true
org.gradle.vfs.watch = false org.gradle.vfs.watch = false
org.gradle.jvmargs = -Xmx3G org.gradle.jvmargs = -Xmx3G
mcVersion=1.20.4
preVersion=false

15
scripts/GetSetENV.sh Normal file
View File

@@ -0,0 +1,15 @@
prop() {
grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//'
}
commitid=$(git log --pretty='%h' -1)
mcversion=$(prop mcVersion)
preVersion=$(prop preVersion)
release_tag="$mcversion-$commitid"
jarName="build/libs/luminol-1.20.4-paperclip.jar"
make_latest=$([ $preVersion = "true" ] && echo "false" || echo "true")
echo "tag=$release_tag" >> $GITHUB_ENV
echo "jar=$jarName" >> $GITHUB_ENV
echo "pre=$preVersion" >> $GITHUB_ENV
echo "make_latest=$make_latest" >> $GITHUB_ENV

View File

@@ -0,0 +1,27 @@
sha256() {
sha256sum $1 | awk '{print $1}'
}
prop() {
grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//'
}
echo "$tag"
project_id="luminol"
project_name="uminol"
mcversion=$(prop mcVersion)
ctime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
pre=$(prop preVersion)
if [ $pre = "true" ]; then
channel="experimental"
else
channel="default"
fi
promoted=false
number=$(git log --oneline master ^`git describe --tags --abbrev=0` | wc -l)
changes=$(git log --pretty='%H<<<%s>>>' -"$number" | sed ':a;N;$!ba;s/\n//g')
jar_name="build/libs/luminol-1.20.4-paperclip.jar"
jar_sha256=`sha256 $jar_name`
# v2
curl --location --request POST "https://api.luminolmc.com/v2/projects/$project_id/$mcversion/build/commit" --header "Content-Type: application/json" --header "Authentication: $secret_v2" --data-raw "{\"project_id\":\"$project_id\",\"version\":\"$mcversion\",\"channel\":\"$channel\",\"changes\":\"$changes\",\"jar_name\":\"$jar_name\",\"sha256\":\"$jar_sha256\",\"tag\":\"$tag\"}"