-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DotNet auto-build and Release on branch updates. + Configuration …
…updates. (#4) * [+] Enable Windows Targeting / Suppress TRIM errors * [+] Auto-build "main" branch to Release Auto-zips and releases. Can be configured for other branches. * Create dotnet_build.yml * Delete .workflows directory * [+] Rewrite I cannot get it to compile using Chinese Characters * [-] Quick fixup
- Loading branch information
Showing
2 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
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: Download static files from repo | ||
run: | | ||
git clone https://github.com/ly-nld/ja-learner-static-files | ||
mv ja-learner-static-files/* ./bin/Release/net6.0-windows/ | ||
mkdir ./bin/Release/net6.0-window/extra_prompts | ||
- name: Create win client archive | ||
run: Compress-Archive -Path ./bin/Release/net6.0-windows/* -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 |
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