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