Skip to content

Commit

Permalink
配置CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Whuihuan committed Nov 14, 2024
1 parent 2120846 commit 6a60369
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build

on:
workflow_dispatch:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

env:
PLUGIN_NAME: Bilibili

jobs:
build:
strategy:
matrix:
platform: [x64, ARM64]

runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Read version
run: |
$json = Get-Content -Path Bilibili/plugin.json | ConvertFrom-Json
echo "PLUGIN_VERSION=$($json.Version)" >> $env:GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Build
run: dotnet build Bilibili.sln --configuration Release /p:Platform=${{matrix.platform}} /p:EnableWindowsTargeting=true

- name: Prepare artifact
run: |
Remove-Item -Path Bilibili/bin/* -Recurse -Include *.xml, *.pdb, PowerToys.*, Wox.*
Rename-Item -Path Bilibili/bin/${{matrix.platform}}/Release -NewName $env:PLUGIN_NAME
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.PLUGIN_NAME}}-${{env.PLUGIN_VERSION}}-${{matrix.platform}}
path: Bilibili/bin/${{matrix.platform}}/*
1 change: 1 addition & 0 deletions Bilibili.Tests/Bilibili.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<Nullable>enable</Nullable>
<AssemblyName>Community.PowerToys.Run.Plugin.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>Community.PowerToys.Run.Plugin.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
<Platforms>AnyCPU;ARM64</Platforms>
</PropertyGroup>

<ItemGroup>
Expand Down
24 changes: 22 additions & 2 deletions Bilibili.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,47 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35327.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bilibili", "Bilibili\Bilibili.csproj", "{3A8F68F0-63CD-4824-A35F-1DE3A31FECED}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bilibili", "Bilibili\Bilibili.csproj", "{3A8F68F0-63CD-4824-A35F-1DE3A31FECED}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bilibili.Tests", "Bilibili.Tests\Bilibili.Tests.csproj", "{98B96B10-7BFE-49E4-8AAD-1CB8481A8E6B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bilibili.Tests", "Bilibili.Tests\Bilibili.Tests.csproj", "{98B96B10-7BFE-49E4-8AAD-1CB8481A8E6B}"
ProjectSection(ProjectDependencies) = postProject
{3A8F68F0-63CD-4824-A35F-1DE3A31FECED} = {3A8F68F0-63CD-4824-A35F-1DE3A31FECED}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3A8F68F0-63CD-4824-A35F-1DE3A31FECED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3A8F68F0-63CD-4824-A35F-1DE3A31FECED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3A8F68F0-63CD-4824-A35F-1DE3A31FECED}.Debug|ARM64.ActiveCfg = Debug|ARM64
{3A8F68F0-63CD-4824-A35F-1DE3A31FECED}.Debug|ARM64.Build.0 = Debug|ARM64
{3A8F68F0-63CD-4824-A35F-1DE3A31FECED}.Debug|x64.ActiveCfg = Debug|x64
{3A8F68F0-63CD-4824-A35F-1DE3A31FECED}.Debug|x64.Build.0 = Debug|x64
{3A8F68F0-63CD-4824-A35F-1DE3A31FECED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3A8F68F0-63CD-4824-A35F-1DE3A31FECED}.Release|Any CPU.Build.0 = Release|Any CPU
{3A8F68F0-63CD-4824-A35F-1DE3A31FECED}.Release|ARM64.ActiveCfg = Release|ARM64
{3A8F68F0-63CD-4824-A35F-1DE3A31FECED}.Release|ARM64.Build.0 = Release|ARM64
{3A8F68F0-63CD-4824-A35F-1DE3A31FECED}.Release|x64.ActiveCfg = Release|x64
{3A8F68F0-63CD-4824-A35F-1DE3A31FECED}.Release|x64.Build.0 = Release|x64
{98B96B10-7BFE-49E4-8AAD-1CB8481A8E6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{98B96B10-7BFE-49E4-8AAD-1CB8481A8E6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{98B96B10-7BFE-49E4-8AAD-1CB8481A8E6B}.Debug|ARM64.ActiveCfg = Debug|ARM64
{98B96B10-7BFE-49E4-8AAD-1CB8481A8E6B}.Debug|ARM64.Build.0 = Debug|ARM64
{98B96B10-7BFE-49E4-8AAD-1CB8481A8E6B}.Debug|x64.ActiveCfg = Debug|Any CPU
{98B96B10-7BFE-49E4-8AAD-1CB8481A8E6B}.Debug|x64.Build.0 = Debug|Any CPU
{98B96B10-7BFE-49E4-8AAD-1CB8481A8E6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{98B96B10-7BFE-49E4-8AAD-1CB8481A8E6B}.Release|Any CPU.Build.0 = Release|Any CPU
{98B96B10-7BFE-49E4-8AAD-1CB8481A8E6B}.Release|ARM64.ActiveCfg = Release|ARM64
{98B96B10-7BFE-49E4-8AAD-1CB8481A8E6B}.Release|ARM64.Build.0 = Release|ARM64
{98B96B10-7BFE-49E4-8AAD-1CB8481A8E6B}.Release|x64.ActiveCfg = Release|Any CPU
{98B96B10-7BFE-49E4-8AAD-1CB8481A8E6B}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 1 addition & 0 deletions Bilibili/Bilibili.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Nullable>enable</Nullable>
<AssemblyName>Community.PowerToys.Run.Plugin.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>Community.PowerToys.Run.Plugin.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
<Platforms>AnyCPU;x64;ARM64</Platforms>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 6a60369

Please sign in to comment.