mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24: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:
|
build:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
# 矩阵配置
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- architecture: x86
|
- architecture: x86
|
||||||
|
13
.github/workflows/release.yml
vendored
13
.github/workflows/release.yml
vendored
@ -1,18 +1,12 @@
|
|||||||
name: Release
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # allows manual triggering
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
create_release:
|
|
||||||
description: 'Create new release'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
# 矩阵配置
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- architecture: x86
|
- architecture: x86
|
||||||
@ -46,10 +40,13 @@ jobs:
|
|||||||
name: ${{ matrix.fname }}
|
name: ${{ matrix.fname }}
|
||||||
path: build/${{ matrix.fname }}.zip
|
path: build/${{ matrix.fname }}.zip
|
||||||
|
|
||||||
|
- name: loaddversion
|
||||||
|
id: loaddversion
|
||||||
|
run: python build.py loaddversion
|
||||||
- name: Release LunaTranslator
|
- name: Release LunaTranslator
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.event.inputs.create_release }}
|
tag_name: ${{ steps.loaddversion.outputs.version }}
|
||||||
files: build/${{ matrix.fname }}.zip
|
files: build/${{ matrix.fname }}.zip
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
8
build.py
8
build.py
@ -1,5 +1,5 @@
|
|||||||
import os, sys
|
import os, sys
|
||||||
import shutil
|
import shutil, json
|
||||||
import subprocess
|
import subprocess
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@ -209,6 +209,12 @@ def buildPlugins():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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]
|
arch = sys.argv[1]
|
||||||
isdebug=len(sys.argv)>2 and int(sys.argv[2])
|
isdebug=len(sys.argv)>2 and int(sys.argv[2])
|
||||||
os.chdir(rootDir)
|
os.chdir(rootDir)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user