测试合并前检查 #9
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: .NET x64 Build, Test, Upload | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Clone and build Vue.js project | |
run: | | |
git clone https://github.com/ks233/ja-learner-webview | |
cd ja-learner-webview | |
npm install | |
npm run build | |
mkdir -p ../ja-learner/dist_vue | |
mv dist ../ja-learner/dist_vue | |
- name: Build C# project for Windows | |
run: dotnet build ja-learner.sln -c Release --no-restore | |
#- name: Test C# project | |
# run: dotnet test --no-build --verbosity normal | |
- name: Move Vue.js dist to C# project | |
run: mv ja-learner/dist_vue/dist ./bin/Release/net6.0-windows/ | |
- name: Create extra_prompts folder | |
run: mkdir ./bin/Release/net6.0-windows/extra_prompts | |
- name: Create win client archive | |
run: | | |
ren ".\bin\Release\net6.0-windows" "ja-learner" | |
Compress-Archive -Path ./bin/Release/ja-learner -DestinationPath client-win-x64.zip | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y年%m月%d日%H%M%S')" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: release-${{ steps.date.outputs.date }} | |
release_name: Release ${{ steps.date.outputs.date }} | |
draft: false | |
prerelease: false | |
- name: Upload Client win7-x64 Asset | |
id: upload-release-client-win-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./client-win-x64.zip | |
asset_name: ja-learner.zip | |
asset_content_type: application/zip |