This commit is contained in:
Connection Refused
2021-04-02 01:34:56 +08:00
parent 37455bb89e
commit 5970e30974
20 changed files with 54 additions and 426 deletions

49
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: Netch CI
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: windows-latest
env:
NetchDataURL: https://github.com/NetchX/NetchData/archive/refs/heads/master.zip
NetchModeURL: https://github.com/NetchX/NetchMode/archive/refs/heads/master.zip
NetchI18NURL: https://github.com/NetchX/NetchTranslation/archive/refs/heads/master.zip
steps:
- name: MSBuild
uses: microsoft/setup-msbuild@v1.0.2
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Submodule
shell: pwsh
run: |
New-Item -ItemType Directory -Name release
Set-Location release
Invoke-WebRequest -Uri $NetchDataURL -OutFile data.zip
Invoke-WebRequest -Uri $NetchModeURL -OutFile mode.zip
Invoke-WebRequest -Uri $NetchI18NURL -OutFile i18n.zip
Expand-Archive -Force -Path data.zip -DestinationPath bin
Expand-Archive -Force -Path mode.zip -DestinationPath .
Expand-Archive -Force -Path i18n.zip -DestinationPath .
Remove-Item -Force README.md
Remove-Item -Force data.zip
Remove-Item -Force mode.zip
Remove-Item -Force i18n.zip
- name: Build
shell: pwsh
run: .\build.ps1 Release -o release
- name: Upload
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v2
with:
name: Netch
path: release

View File

@@ -1,37 +0,0 @@
name: Netch CI
on:
push:
branches-ignore:
dependabot/**
pull_request:
jobs:
build:
name: Build
runs-on: windows-latest
env:
OutputPath: Netch\bin\Publish\Debug
steps:
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.0.2
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 1
- name: Binaries Repo LFS Pull
working-directory: binaries
run: git lfs pull
- name: Build Solution
shell: pwsh
run: .\BUILD.ps1 Release -o ${{ env.OutputPath }}
- name: Upload Artifact
continue-on-error: true
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v2
with:
name: Netch
path: ${{ env.OutputPath }}

View File

@@ -1,4 +1,4 @@
name: Netch Release
name: Netch CI
on:
push:
tags:
@@ -8,20 +8,15 @@ jobs:
name: Build
runs-on: windows-latest
steps:
- name: Setup MSBuild
- name: MSBuild
uses: microsoft/setup-msbuild@v1.0.2
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 1
- name: Binaries Repo LFS Pull
working-directory: binaries
run: git lfs pull
- name: Build Solution
- name: Build
shell: pwsh
run: .\BUILD.ps1
@@ -31,8 +26,8 @@ jobs:
New-Item -ItemType Directory -Path C:\builtfiles -Force > $null
7z a -mx9 C:\builtfiles\Netch.7z .\Netch\bin\Publish\
7z rn C:\builtfiles\Netch.7z Publish Netch
echo "Netch_SHA256=$(.\GetSHA256.ps1 C:\builtfiles\Netch.7z)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "Netch_EXE_SHA256=$(.\GetSHA256.ps1 Netch\bin\Publish\Netch.exe)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "Netch_SHA256=$(.\sha256.ps1 C:\builtfiles\Netch.7z)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "Netch_EXE_SHA256=$(.\sha256.ps1 Netch\bin\Publish\Netch.exe)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Release
uses: softprops/action-gh-release@v1