Merge pull request #181 from yuk7/dependabot/go_modules/src/golang.or… #267
This file contains hidden or 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: Continuous Integration | |
on: | |
push: | |
paths: | |
- "src/**" | |
- "res/**" | |
- "build.bat" | |
- ".github/workflows/**" | |
pull_request: | |
paths: | |
- "src/**" | |
- "res/**" | |
- "build.bat" | |
- ".github/workflows/**" | |
jobs: | |
compile-wsldl-windows: | |
name: Compile wsldl | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
$short_sha = $env:GITHUB_SHA.SubString(0, 7) | |
$Env:GO_BUILD_OPTS = "-ldflags `"-X github.com/yuk7/wsldl/version.version=CI-${short_sha}`"" | |
.\build.bat all | |
Get-ChildItem .\out\icons -File | Get-FileHash -Algorithm SHA256 | ForEach-Object { $_.hash.toLower() + " " + ($_.path | Split-Path -Leaf) } | Tee-Object -FilePath .\out\icons\sha256sums.txt | |
Compress-Archive -Path .\out\icons\* -DestinationPath .\out\icons.zip | |
Get-ChildItem .\out -File | Get-FileHash -Algorithm SHA256 | ForEach-Object { $_.hash.toLower() + " " + ($_.path | Split-Path -Leaf) } | Tee-Object -FilePath .\out\sha256sums.txt | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Build results-Windows | |
path: | | |
out/wsldl.exe | |
out/icons.zip | |
out/sha256sums.txt | |
if-no-files-found: error | |
compile-wsldl-windows-arm64: | |
name: Compile wsldl ARM64 | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
go install github.com/josephspurrier/goversioninfo/cmd/[email protected] | |
$Env:PATH = "${Env:USERPROFILE}\go\bin;${Env:PATH}" | |
$short_sha = $env:GITHUB_SHA.SubString(0, 7) | |
$Env:GO_BUILD_OPTS = "-ldflags `"-X github.com/yuk7/wsldl/version.version=CI-${short_sha}`"" | |
$Env:GOARCH="arm64" | |
.\build.bat all | |
Get-ChildItem .\out\icons -File | Get-FileHash -Algorithm SHA256 | ForEach-Object { $_.hash.toLower() + " " + ($_.path | Split-Path -Leaf) } | Tee-Object -FilePath .\out\icons\sha256sums.txt | |
Compress-Archive -Path .\out\icons -DestinationPath .\out\icons.zip | |
Get-ChildItem .\out -File | Get-FileHash -Algorithm SHA256 | ForEach-Object { $_.hash.toLower() + " " + ($_.path | Split-Path -Leaf) } | Tee-Object -FilePath .\out\sha256sums.txt | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Build results-Windows-ARM64 | |
path: | | |
out/wsldl.exe | |
out/icons.zip | |
out/sha256sums.txt | |
if-no-files-found: error | |
compile-wsldl-linux: | |
name: Cross-compile wsldl from Linux | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest | |
export PATH=$PATH:~/go/bin | |
cd src | |
goversioninfo | |
env GOOS=windows GOARCH=amd64 go build -ldflags "-X github.com/yuk7/wsldl/version.version=CI-Cross-${GITHUB_SHA:0:7}" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Build results-Linux | |
path: | | |
src/wsldl.exe | |
if-no-files-found: error |