From fa23561827a5a6f01d400c90833b44bebf18ff6f Mon Sep 17 00:00:00 2001 From: Connection Refused Date: Fri, 2 Apr 2021 01:49:24 +0800 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 37 ++----------------------------------- download.ps1 | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 35 deletions(-) create mode 100644 download.ps1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10dacb4c..68c594f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,10 +5,6 @@ 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 @@ -18,38 +14,9 @@ jobs: with: fetch-depth: 1 - - name: Submodule + - name: Download shell: pwsh - run: | - New-Item -ItemType Directory -Name release | Out-Null - Set-Location release - - Invoke-WebRequest -Uri ${{ env.NetchDataURL }} -OutFile data.zip - Invoke-WebRequest -Uri ${{ env.NetchModeURL }} -OutFile mode.zip - Invoke-WebRequest -Uri ${{ env.NetchI18NURL }} -OutFile i18n.zip - - Expand-Archive -Force -Path data.zip -DestinationPath . - Expand-Archive -Force -Path mode.zip -DestinationPath . - Expand-Archive -Force -Path i18n.zip -DestinationPath . - - Get-Item * - - New-Item -ItemType Directory -Name bin | Out-Null - New-Item -ItemType Directory -Name mode | Out-Null - New-Item -ItemType Directory -Name i18n | Out-Null - - Copy-Item -Recurse -Force .\NetchData-master\* .\bin - Copy-Item -Recurse -Force .\NetchMode-master\mode\* .\mode - Copy-Item -Recurse -Force .\NetchTranslation-master\i18n\* .\i18n - - Remove-Item -Recurse -Force NetchData-master - Remove-Item -Recurse -Force NetchMode-master - Remove-Item -Recurse -Force NetchTranslation-master - Remove-Item -Force data.zip - Remove-Item -Force mode.zip - Remove-Item -Force i18n.zip - - Get-Item * + run: .\download.ps1 - name: Build shell: pwsh diff --git a/download.ps1 b/download.ps1 new file mode 100644 index 00000000..450c9051 --- /dev/null +++ b/download.ps1 @@ -0,0 +1,32 @@ +$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" + +New-Item -ItemType Directory -Name release | Out-Null +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 . +Expand-Archive -Force -Path mode.zip -DestinationPath . +Expand-Archive -Force -Path i18n.zip -DestinationPath . + +New-Item -ItemType Directory -Name bin | Out-Null +New-Item -ItemType Directory -Name mode | Out-Null +New-Item -ItemType Directory -Name i18n | Out-Null + +Copy-Item -Recurse -Force .\NetchData-master\* .\bin +Copy-Item -Recurse -Force .\NetchMode-master\mode\* .\mode +Copy-Item -Recurse -Force .\NetchTranslation-master\i18n\* .\i18n + +Remove-Item -Recurse -Force NetchData-master +Remove-Item -Recurse -Force NetchMode-master +Remove-Item -Recurse -Force NetchTranslation-master +Remove-Item -Force data.zip +Remove-Item -Force mode.zip +Remove-Item -Force i18n.zip + +Get-Item * +exit 0