动态获取CC版本号 (#237)
* 动态获取CC版本号 release CI使用latest snapshot 使用 pre-release(如果有的话) * Windows 添加安装 requests 模块步骤 Linux及macOS 修正python版本和路径 * macOS 添加安装 requests 步骤 修正命令参数位置 * getLatest接收Repo,使其不止能用在CC上 * 修正macOS使用的pip版本
This commit is contained in:
40
.github/workflows/build.yml
vendored
40
.github/workflows/build.yml
vendored
@@ -38,15 +38,11 @@ jobs:
|
|||||||
- name: Unpack love
|
- name: Unpack love
|
||||||
run: |
|
run: |
|
||||||
7z x .\love-11.3-win64.zip
|
7z x .\love-11.3-win64.zip
|
||||||
- id: CClatest
|
|
||||||
uses: pozetroninc/github-action-get-latest-release@master
|
|
||||||
with:
|
|
||||||
owner: 26F-Studio
|
|
||||||
repo: cold_clear_ai_love2d_wrapper
|
|
||||||
excludes: prerelease, draft
|
|
||||||
- name: Download ColdClear
|
- name: Download ColdClear
|
||||||
run: |
|
run: |
|
||||||
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/${{ steps.CClatest.outputs.release }}/win64.zip
|
pip install requests
|
||||||
|
$CCVersion=python .\.github\workflows\getLatest.py -P
|
||||||
|
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/$CCVersion/win64.zip
|
||||||
- name: Unpack ColdClear
|
- name: Unpack ColdClear
|
||||||
run: |
|
run: |
|
||||||
7z x .\win64.zip -oColdClear
|
7z x .\win64.zip -oColdClear
|
||||||
@@ -112,15 +108,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
chmod 777 ./love-11.3-x86_64.AppImage
|
chmod 777 ./love-11.3-x86_64.AppImage
|
||||||
./love-11.3-x86_64.AppImage --appimage-extract
|
./love-11.3-x86_64.AppImage --appimage-extract
|
||||||
- id: CClatest
|
|
||||||
uses: pozetroninc/github-action-get-latest-release@master
|
|
||||||
with:
|
|
||||||
owner: 26F-Studio
|
|
||||||
repo: cold_clear_ai_love2d_wrapper
|
|
||||||
excludes: prerelease, draft
|
|
||||||
- name: Download ColdClear
|
- name: Download ColdClear
|
||||||
run: |
|
run: |
|
||||||
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/${{ steps.CClatest.outputs.release }}/linux.zip
|
CCVersion=$(python3 ./.github/workflows/getLatest.py -P)
|
||||||
|
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/$CCVersion/linux.zip
|
||||||
- name: Unpack ColdClear
|
- name: Unpack ColdClear
|
||||||
run: |
|
run: |
|
||||||
7z x ./linux.zip -oColdClear
|
7z x ./linux.zip -oColdClear
|
||||||
@@ -187,16 +178,11 @@ jobs:
|
|||||||
yes | ./cmdline-tools/bin/sdkmanager --sdk_root=. --install "platforms;android-30"
|
yes | ./cmdline-tools/bin/sdkmanager --sdk_root=. --install "platforms;android-30"
|
||||||
yes | ./cmdline-tools/bin/sdkmanager --sdk_root=. --install "ndk;21.3.6528147"
|
yes | ./cmdline-tools/bin/sdkmanager --sdk_root=. --install "ndk;21.3.6528147"
|
||||||
export ANDROID_HOME=$(pwd)
|
export ANDROID_HOME=$(pwd)
|
||||||
- id: CClatest
|
|
||||||
uses: pozetroninc/github-action-get-latest-release@master
|
|
||||||
with:
|
|
||||||
owner: 26F-Studio
|
|
||||||
repo: cold_clear_ai_love2d_wrapper
|
|
||||||
excludes: prerelease, draft
|
|
||||||
- name: Download ColdClear
|
- name: Download ColdClear
|
||||||
run: |
|
run: |
|
||||||
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/${{ steps.CClatest.outputs.release }}/android_aarch64.zip
|
CCVersion=$(python3 ./.github/workflows/getLatest.py -P)
|
||||||
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/${{ steps.CClatest.outputs.release }}/android_armv7.zip
|
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/$CCVersion/android_aarch64.zip
|
||||||
|
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/$CCVersion/android_armv7.zip
|
||||||
- name: Unpack ColdClear
|
- name: Unpack ColdClear
|
||||||
run: |
|
run: |
|
||||||
7z x ./android_aarch64.zip -oColdClear/android_aarch64
|
7z x ./android_aarch64.zip -oColdClear/android_aarch64
|
||||||
@@ -259,15 +245,11 @@ jobs:
|
|||||||
- name: Unpack template
|
- name: Unpack template
|
||||||
run: |
|
run: |
|
||||||
7z x ./Techmino.app.zip
|
7z x ./Techmino.app.zip
|
||||||
- id: CClatest
|
|
||||||
uses: pozetroninc/github-action-get-latest-release@master
|
|
||||||
with:
|
|
||||||
owner: 26F-Studio
|
|
||||||
repo: cold_clear_ai_love2d_wrapper
|
|
||||||
excludes: prerelease, draft
|
|
||||||
- name: Get CCloader
|
- name: Get CCloader
|
||||||
run: |
|
run: |
|
||||||
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/${{ steps.CClatest.outputs.release }}/macOS.zip
|
pip3 install requests
|
||||||
|
CCVersion=$(python3 ./.github/workflows/getLatest.py -P)
|
||||||
|
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/$CCVersion/macOS.zip
|
||||||
unzip macOS.zip
|
unzip macOS.zip
|
||||||
- name: Modify template
|
- name: Modify template
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
27
.github/workflows/getLatest.py
vendored
Normal file
27
.github/workflows/getLatest.py
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import requests
|
||||||
|
import time
|
||||||
|
import json
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
def getColdClear(args):
|
||||||
|
while True:
|
||||||
|
get = requests.get(f'https://api.github.com/repos/{args.Repo}/releases')
|
||||||
|
if get.status_code != 200:
|
||||||
|
time.sleep(2)
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
getJson = json.loads(get.text)
|
||||||
|
if args.Pre:
|
||||||
|
print (getJson[0]['tag_name'])
|
||||||
|
else:
|
||||||
|
for i in getJson:
|
||||||
|
if i['prerelease'] == args.Pre:
|
||||||
|
print (i['tag_name'])
|
||||||
|
break
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
parser = argparse.ArgumentParser(description='用于获取Github仓库的最新Release版本名')
|
||||||
|
parser.add_argument('-P', '--Pre', action='store_true', help = '是否获取pre')
|
||||||
|
parser.add_argument('-R', '--Repo', default = '26F-Studio/cold_clear_ai_love2d_wrapper', help = '获取的仓库, 默认为cold_clear_ai_love2d_wrapper, 输入格式为User/Repo')
|
||||||
|
args = parser.parse_args()
|
||||||
|
getColdClear(args)
|
||||||
61
.github/workflows/release.yml
vendored
61
.github/workflows/release.yml
vendored
@@ -34,15 +34,11 @@ jobs:
|
|||||||
- name: Unpack love
|
- name: Unpack love
|
||||||
run: |
|
run: |
|
||||||
7z x .\love-11.3-win64.zip
|
7z x .\love-11.3-win64.zip
|
||||||
- id: CClatest
|
|
||||||
uses: pozetroninc/github-action-get-latest-release@master
|
|
||||||
with:
|
|
||||||
owner: 26F-Studio
|
|
||||||
repo: cold_clear_ai_love2d_wrapper
|
|
||||||
excludes: prerelease, draft
|
|
||||||
- name: Download ColdClear
|
- name: Download ColdClear
|
||||||
run: |
|
run: |
|
||||||
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/${{ steps.CClatest.outputs.release }}/win64.zip
|
pip install requests
|
||||||
|
$CCVersion=python .\.github\workflows\getLatest.py
|
||||||
|
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/$CCVersion/win64.zip
|
||||||
- name: Unpack ColdClear
|
- name: Unpack ColdClear
|
||||||
run: |
|
run: |
|
||||||
7z x .\win64.zip -oColdClear
|
7z x .\win64.zip -oColdClear
|
||||||
@@ -104,15 +100,11 @@ jobs:
|
|||||||
- name: Unpack love
|
- name: Unpack love
|
||||||
run: |
|
run: |
|
||||||
7z x .\love-11.3-win32.zip
|
7z x .\love-11.3-win32.zip
|
||||||
- id: CClatest
|
|
||||||
uses: pozetroninc/github-action-get-latest-release@master
|
|
||||||
with:
|
|
||||||
owner: 26F-Studio
|
|
||||||
repo: cold_clear_ai_love2d_wrapper
|
|
||||||
excludes: prerelease, draft
|
|
||||||
- name: Download ColdClear
|
- name: Download ColdClear
|
||||||
run: |
|
run: |
|
||||||
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/${{ steps.CClatest.outputs.release }}/win32.zip
|
pip install requests
|
||||||
|
$CCVersion=python .\.github\workflows\getLatest.py
|
||||||
|
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/$CCVersion/win32.zip
|
||||||
- name: Unpack ColdClear
|
- name: Unpack ColdClear
|
||||||
run: |
|
run: |
|
||||||
7z x .\win32.zip -oColdClear
|
7z x .\win32.zip -oColdClear
|
||||||
@@ -176,15 +168,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
chmod 777 ./love-11.3-x86_64.AppImage
|
chmod 777 ./love-11.3-x86_64.AppImage
|
||||||
./love-11.3-x86_64.AppImage --appimage-extract
|
./love-11.3-x86_64.AppImage --appimage-extract
|
||||||
- id: CClatest
|
|
||||||
uses: pozetroninc/github-action-get-latest-release@master
|
|
||||||
with:
|
|
||||||
owner: 26F-Studio
|
|
||||||
repo: cold_clear_ai_love2d_wrapper
|
|
||||||
excludes: prerelease, draft
|
|
||||||
- name: Download ColdClear
|
- name: Download ColdClear
|
||||||
run: |
|
run: |
|
||||||
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/${{ steps.CClatest.outputs.release }}/linux.zip
|
CCVersion=$(python3 ./.github/workflows/getLatest.py)
|
||||||
|
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/$CCVersion/linux.zip
|
||||||
- name: Unpack ColdClear
|
- name: Unpack ColdClear
|
||||||
run: |
|
run: |
|
||||||
7z x ./linux.zip -oColdClear
|
7z x ./linux.zip -oColdClear
|
||||||
@@ -248,16 +235,11 @@ jobs:
|
|||||||
yes | ./cmdline-tools/bin/sdkmanager --sdk_root=. --install "platforms;android-30"
|
yes | ./cmdline-tools/bin/sdkmanager --sdk_root=. --install "platforms;android-30"
|
||||||
yes | ./cmdline-tools/bin/sdkmanager --sdk_root=. --install "ndk;21.3.6528147"
|
yes | ./cmdline-tools/bin/sdkmanager --sdk_root=. --install "ndk;21.3.6528147"
|
||||||
export ANDROID_HOME=$(pwd)
|
export ANDROID_HOME=$(pwd)
|
||||||
- id: CClatest
|
|
||||||
uses: pozetroninc/github-action-get-latest-release@master
|
|
||||||
with:
|
|
||||||
owner: 26F-Studio
|
|
||||||
repo: cold_clear_ai_love2d_wrapper
|
|
||||||
excludes: prerelease, draft
|
|
||||||
- name: Download ColdClear
|
- name: Download ColdClear
|
||||||
run: |
|
run: |
|
||||||
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/${{ steps.CClatest.outputs.release }}/android_aarch64.zip
|
CCVersion=$(python3 ./.github/workflows/getLatest.py)
|
||||||
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/${{ steps.CClatest.outputs.release }}/android_armv7.zip
|
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/$CCVersion/android_aarch64.zip
|
||||||
|
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/$CCVersion/android_armv7.zip
|
||||||
- name: Unpack ColdClear
|
- name: Unpack ColdClear
|
||||||
run: |
|
run: |
|
||||||
7z x ./android_aarch64.zip -oColdClear/android_aarch64
|
7z x ./android_aarch64.zip -oColdClear/android_aarch64
|
||||||
@@ -326,16 +308,11 @@ jobs:
|
|||||||
yes | ./cmdline-tools/bin/sdkmanager --sdk_root=. --install "platforms;android-30"
|
yes | ./cmdline-tools/bin/sdkmanager --sdk_root=. --install "platforms;android-30"
|
||||||
yes | ./cmdline-tools/bin/sdkmanager --sdk_root=. --install "ndk;21.3.6528147"
|
yes | ./cmdline-tools/bin/sdkmanager --sdk_root=. --install "ndk;21.3.6528147"
|
||||||
export ANDROID_HOME=$(pwd)
|
export ANDROID_HOME=$(pwd)
|
||||||
- id: CClatest
|
|
||||||
uses: pozetroninc/github-action-get-latest-release@master
|
|
||||||
with:
|
|
||||||
owner: 26F-Studio
|
|
||||||
repo: cold_clear_ai_love2d_wrapper
|
|
||||||
excludes: prerelease, draft
|
|
||||||
- name: Download ColdClear
|
- name: Download ColdClear
|
||||||
run: |
|
run: |
|
||||||
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/${{ steps.CClatest.outputs.release }}/android_aarch64.zip
|
CCVersion=$(python3 ./.github/workflows/getLatest.py)
|
||||||
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/${{ steps.CClatest.outputs.release }}/android_armv7.zip
|
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/$CCVersion/android_aarch64.zip
|
||||||
|
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/$CCVersion/android_armv7.zip
|
||||||
- name: Unpack ColdClear
|
- name: Unpack ColdClear
|
||||||
run: |
|
run: |
|
||||||
7z x ./android_aarch64.zip -oColdClear/android_aarch64
|
7z x ./android_aarch64.zip -oColdClear/android_aarch64
|
||||||
@@ -396,15 +373,11 @@ jobs:
|
|||||||
- name: Unpack template
|
- name: Unpack template
|
||||||
run: |
|
run: |
|
||||||
7z x ./Techmino.app.zip
|
7z x ./Techmino.app.zip
|
||||||
- id: CClatest
|
|
||||||
uses: pozetroninc/github-action-get-latest-release@master
|
|
||||||
with:
|
|
||||||
owner: 26F-Studio
|
|
||||||
repo: cold_clear_ai_love2d_wrapper
|
|
||||||
excludes: prerelease, draft
|
|
||||||
- name: Get CCloader
|
- name: Get CCloader
|
||||||
run: |
|
run: |
|
||||||
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/${{ steps.CClatest.outputs.release }}/macOS.zip
|
pip3 install requests
|
||||||
|
CCVersion=$(python3 ./.github/workflows/getLatest.py)
|
||||||
|
curl -OL https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/$CCVersion/macOS.zip
|
||||||
unzip macOS.zip
|
unzip macOS.zip
|
||||||
- name: Modify template
|
- name: Modify template
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user