From 2cc88f7a1dffa54862f79e06f9785283e636412f Mon Sep 17 00:00:00 2001 From: xian18 <44394537+xian18@users.noreply.github.com> Date: Mon, 1 May 2023 22:34:58 +0800 Subject: [PATCH] Add PC CI --- .gitea/workflows/pc_builder.yaml | 50 ++++++++++++++++++++++++++++++++ .gitignore | 3 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/pc_builder.yaml diff --git a/.gitea/workflows/pc_builder.yaml b/.gitea/workflows/pc_builder.yaml new file mode 100644 index 0000000..aea30ba --- /dev/null +++ b/.gitea/workflows/pc_builder.yaml @@ -0,0 +1,50 @@ +name: PC 打包使用 +run-name: ${{ gitea.actor }} 正在打包新版 PC +on: + workflow_dispatch: + inputs: + gameVersion: + description: '游戏版本' + required: true + nwjsVersion: + description: 'nw.js 版本' + required: true + default: '0.75.1' + +jobs: + PC-Build: + runs-on: ubuntu-latest + strategy: + max-parallel: 1 + matrix: + include: + - target_arch: 'win-x64' + compress_form: 'zip' + - target_arch: 'win-ia32' + compress_form: 'zip' + - target_arch: 'osx-x64' + compress_form: 'zip' + - target_arch: 'linux-x64' + compress_form: 'tar.gz' + - target_arch: 'linux-ia32' + compress_form: 'tar.gz' + steps: + - name: Download nwjs + run: | + export NWJS_VERSION=${{ github.event.inputs.nwjsVersion }} + export NWJS_ARCH=${{ matrix.target_arch }} + export NWJS_COMPRESS_FORM=${{ matrix.compress_form }} + wget https://dl.nwjs.io/v${NWJS_VERSION}/nwjs-v${NWJS_VERSION}-${NWJS_ARCH}.${NWJS_COMPRESS_FORM} + + - name: Extract nwjs + run: | + export NWJS_VERSION=${{ github.event.inputs.nwjsVersion }} + export NWJS_ARCH=${{ matrix.target_arch }} + export NWJS_COMPRESS_FORM=${{ matrix.compress_form }} + if [ "${NWJS_COMPRESS_FORM}" = "zip" ]; then + unzip nwjs-v${NWJS_VERSION}-${NWJS_ARCH}.${NWJS_COMPRESS_FORM} + else + tar -xzf nwjs-v${NWJS_VERSION}-${NWJS_ARCH}.${NWJS_COMPRESS_FORM} + fi + + ls -l diff --git a/.gitignore b/.gitignore index 26fc9ce..35b69d1 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ !/movies/**/*.webm !/fonts/*.css !/fonts/*.tff -!*.md \ No newline at end of file +!*.md +!/.gitea/**/*.yaml