From 312435c8deac96378d0a4548d48aac44621d0b3d Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Thu, 4 Feb 2021 15:49:52 +0300 Subject: [PATCH] Create Sophia2.yml --- .github/workflows/Sophia2.yml | 105 ++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 .github/workflows/Sophia2.yml diff --git a/.github/workflows/Sophia2.yml b/.github/workflows/Sophia2.yml new file mode 100644 index 00000000..877521c7 --- /dev/null +++ b/.github/workflows/Sophia2.yml @@ -0,0 +1,105 @@ +name: Archives + +on: + push: + tags: + - '*.*.*' + - '*.*' + +jobs: + patch: + runs-on: windows-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@master + - name: Build 5.x + run: | + $BUILD_DIR = "Sophia Script v" + if ($env:GITHUB_REF -eq "refs/heads/master") + { + $BUILD_DIR += "master" + } + else + { + $BUILD_DIR += ${env:GITHUB_REF} -replace "refs/tags/", "" + } + + $ZIP = "$BUILD_DIR.zip" + + New-Item -Path $BUILD_DIR -ItemType Directory -Force + + Write-Host $BUILD_DIR + Write-Host $ZIP + + Copy-Item -Path "Sophia\PowerShell 5.1\*" -Destination $BUILD_DIR -Recurse -Force + Copy-Item -Path "Start menu pinning\syspin.exe" -Destination $BUILD_DIR -Force + + Compress-Archive -Path $BUILD_DIR -DestinationPath $ZIP -Force + + - name: Build 7.x + run: | + $BUILD_DIR = "Sophia Script v" + if ($env:GITHUB_REF -eq "refs/heads/master") + { + $BUILD_DIR += "master" + } + else + { + $BUILD_DIR += ${env:GITHUB_REF} -replace "refs/tags/", "" + } + $BUILD_DIR += " PS7.x" + + $ZIP = "$BUILD_DIR.zip" + + New-Item -Path $BUILD_DIR -ItemType Directory -Force + + Write-Host $BUILD_DIR + Write-Host $ZIP + + Copy-Item -Path "Sophia\PowerShell 5.1\*" -Destination $BUILD_DIR -Recurse -Force + Copy-Item -Path "Sophia\PowerShell 7.x\*" -Destination $BUILD_DIR -Recurse -Force + Copy-Item -Path "Start menu pinning\syspin.exe" -Destination $BUILD_DIR -Recurse -Force + + Compress-Archive -Path $BUILD_DIR -DestinationPath $ZIP -Force + + - name: Build LTSC + run: | + $BUILD_DIR = "Sophia Script LTSC v" + $ModuleVersion = (Import-PowerShellDataFile -Path "Sophia\LTSC\Sophia.psd1").ModuleVersion + Write-Host $ModuleVersion + $BUILD_DIR += $ModuleVersion + + $ZIP = "$BUILD_DIR.zip" + + New-Item -Path $BUILD_DIR -ItemType Directory -Force + + Write-Host $BUILD_DIR + Write-Host $ZIP + + Copy-Item -Path "Sophia\LTSC\*" -Destination $BUILD_DIR -Recurse -Force + + Compress-Archive -Path $BUILD_DIR -DestinationPath $ZIP -Force + + - name: Wrapper + run: | + $BUILD_DIR = "Sophia Script Wrapper" + $ZIP = "$BUILD_DIR.zip" + + New-Item -Path $BUILD_DIR -ItemType Directory -Force + + Write-Host $BUILD_DIR + Write-Host $ZIP + + Copy-Item -Path "Wrapper\*" -Destination $BUILD_DIR -Recurse -Force + Compress-Archive -Path $BUILD_DIR -DestinationPath $ZIP -Force + + - name: Upload archives to release + uses: svenstaro/upload-release-action@master + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: Sophia*.zip + tag: ${{ github.ref }} + overwrite: true + file_glob: true + prerelease: false +