misc 修改版本号 #150
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: publish | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| env: | |
| REPO_NAME: "ASFEnhance" | |
| PROJECT_NAME: "ASFEnhance" | |
| PLUGIN_NAME: "ASFEnhance.dll" | |
| PROJECT_NAME2: "ASFEnhance.IPC" | |
| PLUGIN_NAME2: "ASFEnhance.IPC.dll" | |
| DOTNET_SDK_VERSION: 10.0 | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v5.2.0 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_SDK_VERSION }} | |
| - name: Verify .NET Core | |
| run: dotnet --info | |
| - name: Restore packages in preparation for ${{ env.PROJECT_NAME }} publishing | |
| run: dotnet restore ${{ env.PROJECT_NAME }} -p:ContinuousIntegrationBuild=true --nologo | |
| - name: Publish ${{ env.PROJECT_NAME }} | |
| run: dotnet publish ${{ env.PROJECT_NAME }} -o:"./publish/" -c:Release | |
| - name: Collect files | |
| shell: pwsh | |
| run: | | |
| if (-Not (Test-Path -Path ./tmp)) { | |
| New-Item -ItemType Directory -Path ./tmp | |
| } | |
| else { | |
| Remove-Item -Path ./tmp/* -Recurse -Force | |
| } | |
| Copy-Item -Path .\publish\${{ env.PLUGIN_NAME }} -Destination .\tmp\ | |
| $dirs = Get-ChildItem -Path ./publish -Directory | |
| foreach ($dir in $dirs) { | |
| $subFiles = Get-ChildItem -Path $dir.FullName -File -Filter *.resources.dll | |
| foreach ($file in $subFiles) { | |
| $resourceName = [System.IO.Path]::GetFileNameWithoutExtension($file.Name) | |
| $opDir = "./tmp/$resourceName" | |
| if (-Not (Test-Path -Path $opDir)) { | |
| New-Item -ItemType Directory -Path $opDir | |
| } | |
| $destinationPath = ".\tmp\$resourceName\$($dir.Name).dll" | |
| Copy-Item -Path $file -Destination $destinationPath | |
| Write-Output "Copy resource DLL $($file.FullName) -> $destinationPath" | |
| } | |
| } | |
| - name: Zip files | |
| run: 7z a -bd -slp -tzip -mm=Deflate -mx=5 -mfb=150 -mpass=10 "./dist/${{ env.PROJECT_NAME }}.zip" "./tmp/*" | |
| - name: Upload ${{ env.PROJECT_NAME }} | |
| continue-on-error: true | |
| uses: actions/upload-artifact@v7.0.0 | |
| with: | |
| if-no-files-found: error | |
| name: ${{ env.PROJECT_NAME }}.zip | |
| path: ./dist/${{ env.PROJECT_NAME }}.zip | |
| # Build ASFEnhance.IPC | |
| - name: Restore packages in preparation for ${{ env.PROJECT_NAME2 }} publishing | |
| run: dotnet restore ${{ env.PROJECT_NAME2 }} -p:ContinuousIntegrationBuild=true --nologo | |
| - name: Publish ${{ env.PROJECT_NAME2 }} | |
| run: dotnet publish ${{ env.PROJECT_NAME2 }} -o:"./publish/" -c:Release | |
| - name: Collect files | |
| shell: pwsh | |
| run: | | |
| if (-Not (Test-Path -Path ./tmp)) { | |
| New-Item -ItemType Directory -Path ./tmp | |
| } | |
| else { | |
| Remove-Item -Path ./tmp/* -Recurse -Force | |
| } | |
| Copy-Item -Path .\publish\${{ env.PLUGIN_NAME2 }} -Destination .\tmp\ | |
| - name: Zip files | |
| run: 7z a -bd -slp -tzip -mm=Deflate -mx=5 -mfb=150 -mpass=10 "./dist/${{ env.PROJECT_NAME2 }}.zip" "./tmp/*" | |
| - name: Upload ${{ env.PROJECT_NAME2 }} | |
| continue-on-error: true | |
| uses: actions/upload-artifact@v7.0.0 | |
| with: | |
| if-no-files-found: error | |
| name: ${{ env.PROJECT_NAME2 }}.zip | |
| path: ./dist/${{ env.PROJECT_NAME2 }}.zip | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Download ${{ env.PROJECT_NAME }} artifact from windows-latest | |
| uses: actions/download-artifact@v8.0.1 | |
| with: | |
| name: ${{ env.PROJECT_NAME }}.zip | |
| path: out | |
| - name: Download ${{ env.PROJECT_NAME2 }} artifact from windows-latest | |
| uses: actions/download-artifact@v8.0.1 | |
| with: | |
| name: ${{ env.PROJECT_NAME2 }}.zip | |
| path: out | |
| - name: Create ${{ env.PROJECT_NAME }} GitHub release | |
| uses: ncipollo/release-action@v1.20.0 | |
| with: | |
| artifacts: "out/*" | |
| makeLatest: false | |
| prerelease: true | |
| tag: ${{ github.ref_name }} | |
| name: ${{ env.PROJECT_NAME }} ${{ github.ref_name }} | |
| body: | | |
|   | |
| Help improve translation: [](https://crowdin.com/project/asfenhance) | |
| --- | |
| ASFEnhance.zip : Plugin with Command / 插件本体 | |
| ASFEnhance.IPC.zip : Plugin with IPC Interface (Require install with ASFEnhance) / 插件的 IPC 接口 (需要和 ASFEnhance 一起安装) | |
| --- | |
| release created by github actions |