mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-28 08:04:13 +08:00
auto load version
This commit is contained in:
parent
b555b32393
commit
221dda18d9
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
@ -10,7 +10,6 @@ jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
# 矩阵配置
|
||||
matrix:
|
||||
include:
|
||||
- architecture: x86
|
||||
|
13
.github/workflows/release.yml
vendored
13
.github/workflows/release.yml
vendored
@ -1,18 +1,12 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
workflow_dispatch: # allows manual triggering
|
||||
inputs:
|
||||
create_release:
|
||||
description: 'Create new release'
|
||||
required: true
|
||||
type: string
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
# 矩阵配置
|
||||
matrix:
|
||||
include:
|
||||
- architecture: x86
|
||||
@ -46,10 +40,13 @@ jobs:
|
||||
name: ${{ matrix.fname }}
|
||||
path: build/${{ matrix.fname }}.zip
|
||||
|
||||
- name: loaddversion
|
||||
id: loaddversion
|
||||
run: python build.py loaddversion
|
||||
- name: Release LunaTranslator
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ github.event.inputs.create_release }}
|
||||
tag_name: ${{ steps.loaddversion.outputs.version }}
|
||||
files: build/${{ matrix.fname }}.zip
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
8
build.py
8
build.py
@ -1,5 +1,5 @@
|
||||
import os, sys
|
||||
import shutil
|
||||
import shutil, json
|
||||
import subprocess
|
||||
import requests
|
||||
|
||||
@ -209,6 +209,12 @@ def buildPlugins():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if sys.argv[1]=='loaddversion':
|
||||
os.chdir(rootDir)
|
||||
with open('LunaTranslator/files/defaultconfig/static_data.json','r',encoding='utf8') as ff:
|
||||
version=json.loads(ff.read())['version']
|
||||
print('::set-output name=version::'+version)
|
||||
exit()
|
||||
arch = sys.argv[1]
|
||||
isdebug=len(sys.argv)>2 and int(sys.argv[2])
|
||||
os.chdir(rootDir)
|
||||
|
Loading…
x
Reference in New Issue
Block a user