mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-08-03 19:36:53 -04:00
Update GitHub workflow configuration
This commit is contained in:
parent
d20adb20d3
commit
bcb29ef792
15
.github/workflows/check-update.yml
vendored
15
.github/workflows/check-update.yml
vendored
@ -1,16 +1,14 @@
|
|||||||
name: Check Update
|
name: Check Update
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
branches:
|
schedule:
|
||||||
- javafx
|
- cron: '30 * * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-update:
|
check-update:
|
||||||
if: ${{ github.repository_owner == 'huanghongxun' }}
|
if: ${{ github.repository_owner == 'huanghongxun' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
HMCL_BASE_VERSION: '3.4'
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Fetch tags
|
- name: Fetch tags
|
||||||
@ -21,6 +19,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
wget -O ci.json https://ci.huangyuhui.net/job/HMCL/lastSuccessfulBuild/api/json
|
wget -O ci.json https://ci.huangyuhui.net/job/HMCL/lastSuccessfulBuild/api/json
|
||||||
|
|
||||||
|
export HMCL_EXE_FILE_NAME=`cat ci.json | jq -M -r '.artifacts[] | select(.fileName | endswith(".exe")) | .fileName'`
|
||||||
|
if [ -z `echo $HMCL_EXE_FILE_NAME | grep "^HMCL-[0-9]\.[0-9]\.[0-9]\{3\}\.exe\$"` ]; then exit 1; fi
|
||||||
|
|
||||||
|
export HMCL_BASE_VERSION=${HMCL_EXE_FILE_NAME:5:3}
|
||||||
export HMCL_BUILD_NUMBER=`cat ci.json | jq -M -r '.id'`
|
export HMCL_BUILD_NUMBER=`cat ci.json | jq -M -r '.id'`
|
||||||
export HMCL_VERSION="$HMCL_BASE_VERSION.$HMCL_BUILD_NUMBER"
|
export HMCL_VERSION="$HMCL_BASE_VERSION.$HMCL_BUILD_NUMBER"
|
||||||
export HMCL_COMMIT_SHA=`cat ci.json | jq -M -r '.actions[] | select(._class == "hudson.plugins.git.util.BuildData") | .lastBuiltRevision.SHA1'`
|
export HMCL_COMMIT_SHA=`cat ci.json | jq -M -r '.actions[] | select(._class == "hudson.plugins.git.util.BuildData") | .lastBuiltRevision.SHA1'`
|
||||||
@ -28,6 +30,7 @@ jobs:
|
|||||||
if [ "${#HMCL_BUILD_NUMBER}" != 3 ]; then exit 1; fi
|
if [ "${#HMCL_BUILD_NUMBER}" != 3 ]; then exit 1; fi
|
||||||
if [ "${#HMCL_COMMIT_SHA}" != 40 ]; then exit 1; fi
|
if [ "${#HMCL_COMMIT_SHA}" != 40 ]; then exit 1; fi
|
||||||
|
|
||||||
|
echo "HMCL_BASE_VERSION=$HMCL_BASE_VERSION" >> $GITHUB_ENV
|
||||||
echo "HMCL_BUILD_NUMBER=$HMCL_BUILD_NUMBER" >> $GITHUB_ENV
|
echo "HMCL_BUILD_NUMBER=$HMCL_BUILD_NUMBER" >> $GITHUB_ENV
|
||||||
echo "HMCL_VERSION=$HMCL_VERSION" >> $GITHUB_ENV
|
echo "HMCL_VERSION=$HMCL_VERSION" >> $GITHUB_ENV
|
||||||
echo "HMCL_COMMIT_SHA=$HMCL_COMMIT_SHA" >> $GITHUB_ENV
|
echo "HMCL_COMMIT_SHA=$HMCL_COMMIT_SHA" >> $GITHUB_ENV
|
||||||
@ -63,5 +66,3 @@ jobs:
|
|||||||
target_commitish: ${{ env.HMCL_COMMIT_SHA }}
|
target_commitish: ${{ env.HMCL_COMMIT_SHA }}
|
||||||
name: ${{ env.HMCL_TAG_NAME }}
|
name: ${{ env.HMCL_TAG_NAME }}
|
||||||
tag_name: ${{ env.HMCL_TAG_NAME }}
|
tag_name: ${{ env.HMCL_TAG_NAME }}
|
||||||
|
|
||||||
|
|
||||||
|
44
.github/workflows/release.yml
vendored
44
.github/workflows/release.yml
vendored
@ -1,44 +0,0 @@
|
|||||||
name: Create Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v*.*.*"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check and set HMCL version
|
|
||||||
run: |
|
|
||||||
export HMCL_VERSION=`echo ${{ github.ref }} | awk '{print substr($0,12)}'`
|
|
||||||
echo "HMCL_VERSION=$HMCL_VERSION" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
if [ -z `echo $HMCL_VERSION | grep "^[0-9]\.[0-9]\.[0-9]\{3\}\$"` ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "HMCL_BUILD_NUMBER=`echo $HMCL_VERSION | awk '{print substr($0,5)}'`" >> $GITHUB_ENV
|
|
||||||
- name: Download artifacts
|
|
||||||
run: |
|
|
||||||
wget "$DOWNLOAD_BASE_URL/HMCL-$HMCL_VERSION.exe"
|
|
||||||
wget "$DOWNLOAD_BASE_URL/HMCL-$HMCL_VERSION.exe.sha1"
|
|
||||||
wget "$DOWNLOAD_BASE_URL/HMCL-$HMCL_VERSION.jar"
|
|
||||||
wget "$DOWNLOAD_BASE_URL/HMCL-$HMCL_VERSION.jar.sha1"
|
|
||||||
env:
|
|
||||||
DOWNLOAD_BASE_URL: https://ci.huangyuhui.net/job/HMCL/${{ env.HMCL_BUILD_NUMBER }}/artifact/HMCL/build/libs
|
|
||||||
- name: Generate release note
|
|
||||||
run: |
|
|
||||||
echo "HMCL v$HMCL_VERSION" >> RELEASE_NOTE
|
|
||||||
echo "" >> RELEASE_NOTE
|
|
||||||
echo "The full changelogs can be found on the website: https://hmcl.huangyuhui.net/changelog/dev.html" >> RELEASE_NOTE
|
|
||||||
echo "Notice: changelogs are written in Chinese." >> RELEASE_NOTE
|
|
||||||
- name: Create release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
body_path: RELEASE_NOTE
|
|
||||||
files: |
|
|
||||||
HMCL-${{ env.HMCL_VERSION }}.exe
|
|
||||||
HMCL-${{ env.HMCL_VERSION }}.exe.sha1
|
|
||||||
HMCL-${{ env.HMCL_VERSION }}.jar
|
|
||||||
HMCL-${{ env.HMCL_VERSION }}.jar.sha1
|
|
Loading…
x
Reference in New Issue
Block a user