Build updater #5
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: Build updater | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - updater/** | |
| jobs: | |
| build-updater-linux: | |
| name: Build updater for Linux | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go (v4, with module caching) | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.21.3' | |
| cache: modules | |
| - name: Create output dir | |
| run: mkdir -p updater/output | |
| - name: Build (Linux amd64) | |
| run: | | |
| CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ | |
| go build -o updater/output/updater-linux-64 ./updater | |
| - name: Upload Linux artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: updater-linux | |
| path: updater/output/* | |
| build-updater-windows: | |
| name: Build updater for Windows | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go (v4, with module caching) | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.21.3' | |
| cache: modules | |
| - name: Create output dir | |
| shell: pwsh | |
| run: New-Item -ItemType Directory -Path updater\output -Force | |
| - name: Build (Windows amd64) | |
| shell: pwsh | |
| run: | | |
| $Env:CGO_ENABLED = '0' | |
| go build -o updater\output\updater-windows-64.exe ./updater | |
| - name: Upload Windows artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: updater-windows | |
| path: updater\output\* | |
| build-updater-mac: | |
| name: Build updater for macOS | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go (v4, with module caching) | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.21.3' | |
| cache: modules | |
| - name: Create output dir | |
| run: mkdir -p updater/output | |
| - name: Build (macOS Intel) | |
| run: | | |
| CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 \ | |
| go build -o updater/output/updater-macos-64 ./updater | |
| - name: Build (macOS ARM64) | |
| run: | | |
| CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 \ | |
| go build -o updater/output/updater-macos-m1-64 ./updater | |
| - name: Upload macOS artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: updater-macos | |
| path: updater/output/* |