ci.添加 MaaWpf 和 MaaResource 的 Release

This commit is contained in:
Liam Sho
2022-05-09 21:48:12 +08:00
parent a919fe8b80
commit 466786dc7a
3 changed files with 93 additions and 0 deletions

View File

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

38
.github/workflows/maa-release-wpf.yaml vendored Normal file
View File

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

16
read_path.ps1 Normal file
View File

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