auto load version

This commit is contained in:
恍兮惚兮 2024-04-27 19:56:54 +08:00
parent b555b32393
commit 221dda18d9
3 changed files with 12 additions and 10 deletions

View File

@ -10,7 +10,6 @@ jobs:
build:
runs-on: windows-latest
strategy:
# 矩阵配置
matrix:
include:
- architecture: x86

View File

@ -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 }}

View File

@ -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)