Windows 32 bits build attempt #82
This file contains 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 | |
on: | |
push: | |
branches: ["main"] | |
tags: ["v*"] | |
pull_request: | |
branches: ["main"] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [windows-2019] | |
runs-on: ${{ matrix.os }} | |
env: | |
CGO_ENABLED: 1 | |
GOARCH: 386 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Alsa headers | |
run: sudo apt-get install libasound2-dev | |
if: startsWith(matrix.os, 'ubuntu') | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.20 | |
- name: Release version number | |
run: echo '${{ github.ref_name}}' > VERSION | |
if: ${{ github.ref_type == 'tag' }} | |
- name: Development version number | |
run: echo 'dev-${{ github.sha}}' > VERSION | |
if: ${{ github.ref_type == 'branch' }} | |
- name: Build linux|mac | |
run: go build -o bin/signls && chmod +x bin/signls | |
if: ${{ !startsWith(matrix.os, 'windows') }} | |
- name: Build windows | |
run: go build -ldflags "-linkmode 'external' -extldflags '-static'" -o bin/signls.exe | |
if: startsWith(matrix.os, 'windows') | |
- name: Build windows 32 | |
run: go build -ldflags "-linkmode 'external' -extldflags '-static'" -o bin/signls32.exe | |
if: startsWith(matrix.os, 'windows') | |
- name: Tar.gz linux|mac files | |
run: tar -zcvf signls_${{ github.ref_name }}_${{ runner.os}}.tar.gz LICENSE -C bin signls | |
if: ${{ !startsWith(matrix.os, 'windows') }} | |
- name: Zip windows files | |
shell: pwsh | |
run: | | |
Compress-Archive bin\signls.exe signls_${{ github.ref_name }}_${{ runner.os}}.zip | |
if: ${{ startsWith(matrix.os, 'windows') }} | |
- name: Zip windows 32 files | |
shell: pwsh | |
run: | | |
Compress-Archive bin\signls32.exe signls_${{ github.ref_name }}_${{ runner.os}}_32.zip | |
if: ${{ startsWith(matrix.os, 'windows') }} | |
- name: Upload linux|mac artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: signls_${{ github.sha }}_${{ runner.os}} | |
path: signls_${{ github.ref_name }}_${{ runner.os}}.tar.gz | |
if-no-files-found: error | |
if: ${{ !startsWith(matrix.os, 'windows') }} | |
- name: Upload windows artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: signls_${{ github.sha }}_${{ runner.os}} | |
path: signls_${{ github.ref_name }}_${{ runner.os}}.zip | |
if-no-files-found: error | |
if: ${{ startsWith(matrix.os, 'windows') }} | |
- name: Upload windows 32 artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: signls_${{ github.sha }}_${{ runner.os}}_32 | |
path: signls_${{ github.ref_name }}_${{ runner.os}}_32.zip | |
if-no-files-found: error | |
if: ${{ startsWith(matrix.os, 'windows') }} | |
release: | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
name: signls_${{ github.sha }}_macOS | |
- uses: actions/[email protected] | |
with: | |
name: signls_${{ github.sha }}_Linux | |
- uses: actions/[email protected] | |
with: | |
name: signls_${{ github.sha }}_Windows | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
signls_*.tar.gz | |
signls_*.zip |