修复一些错误导致的下载失败及升级到.net9 #24
Workflow file for this run
This file contains 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: main | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- "*" | |
jobs: | |
package: | |
runs-on: windows-latest | |
env: | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
DOTNET_NOLOGO: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 9.0.x | |
- name: Publish | |
run: | | |
dotnet publish BiliDownloader/ -o BiliDownloader/bin/Publish --configuration Release | |
dotnet publish BiliDownloader/ -o BiliDownloader/bin/PublishSingleFile -c Release --self-contained true -r win-x64 -p:PublishSingleFile=true | |
- name: Upload artifacts normal | |
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: BiliDownloader | |
path: BiliDownloader/bin/Publish | |
- name: Upload artifacts single file | |
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: BiliDownloader-SingleFile | |
path: BiliDownloader/bin/PublishSingleFile | |
deploy: | |
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }} | |
needs: package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts normal | |
uses: actions/download-artifact@v3 | |
with: | |
name: BiliDownloader | |
path: BiliDownloader | |
- name: Download artifacts single file | |
uses: actions/download-artifact@v3 | |
with: | |
name: BiliDownloader-SingleFile | |
path: BiliDownloader-SingleFile | |
- name: Create package | |
run: | | |
Compress-Archive -Path BiliDownloader/* -DestinationPath BiliDownloader.zip -Force | |
Compress-Archive -Path BiliDownloader-SingleFile/* -DestinationPath BiliDownloader-SingleFile.zip -Force | |
shell: pwsh | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body: | | |
- [更新日志](https://github.com/Harlan-H/BiliDownloader/blob/master/Changelog.md) | |
draft: false | |
prerelease: false | |
files: | | |
BiliDownloader.zip | |
BiliDownloader-SingleFile.zip |