From 466786dc7aa562ca9f76eb6258ebdcbcbb2e44f0 Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 21:48:12 +0800 Subject: [PATCH] =?UTF-8?q?ci.=E6=B7=BB=E5=8A=A0=20MaaWpf=20=E5=92=8C=20Ma?= =?UTF-8?q?aResource=20=E7=9A=84=20Release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-release-resource.yaml | 39 +++++++++++++++++++++ .github/workflows/maa-release-wpf.yaml | 38 ++++++++++++++++++++ read_path.ps1 | 16 +++++++++ 3 files changed, 93 insertions(+) create mode 100644 .github/workflows/maa-release-resource.yaml create mode 100644 .github/workflows/maa-release-wpf.yaml create mode 100644 read_path.ps1 diff --git a/.github/workflows/maa-release-resource.yaml b/.github/workflows/maa-release-resource.yaml new file mode 100644 index 0000000000..d68e94c4da --- /dev/null +++ b/.github/workflows/maa-release-resource.yaml @@ -0,0 +1,39 @@ +name: Release MaaResource + +on: + push: + branches: + - master + paths: + - resource/** + - 3rdparty/resource/** + workflow_dispatch: + +jobs: + + release-resource: + + runs-on: windows-latest + + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup .NET 6.0.x + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Run release resource task + run: pwsh .\build.ps1 ReleaseResource + + - name: Read file name + id: read_path + run: pwsh .\read_path.ps1 ./artifacts MaaResource* + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.read_path.outputs.name_0 }} + path: ${{ steps.read_path.outputs.path_0 }} diff --git a/.github/workflows/maa-release-wpf.yaml b/.github/workflows/maa-release-wpf.yaml new file mode 100644 index 0000000000..6dadea0963 --- /dev/null +++ b/.github/workflows/maa-release-wpf.yaml @@ -0,0 +1,38 @@ +name: Release MaaWpf + +on: + push: + branches: + - master + paths: + - src/MeoAsstGui/** + workflow_dispatch: + +jobs: + + release-wpf: + + runs-on: windows-latest + + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup .NET 6.0.x + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Run release wpf task + run: pwsh .\build.ps1 ReleaseWpf + + - name: Read file name + id: read_path + run: pwsh .\read_path.ps1 ./artifacts MaaWpf* + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.read_path.outputs.name_0 }} + path: ${{ steps.read_path.outputs.path_0 }} diff --git a/read_path.ps1 b/read_path.ps1 new file mode 100644 index 0000000000..6cfb1aaf0e --- /dev/null +++ b/read_path.ps1 @@ -0,0 +1,16 @@ +if ($args.Length -ne 2) { + throw "Need two arguments" +} + +$fs = Get-ChildItem -Path $args[0] -Filter $args[1] + +$index = 0 +foreach($f in $fs) { + + $name = $f.Name + $path = $f.FullName + Write-Output "::set-output name=name_$index::$name" + Write-Output "::set-output name=path_$index::$path" + + $index = $index + 1 +}