Skip to content

Commit

Permalink
use less confusing build artifact names
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Mar 19, 2024
1 parent 7f2425c commit 6477498
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 24 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
fail-fast: false
matrix:
go-os: [linux, freebsd]
go-arch: [386, amd64, arm64]
go-arch: [i386, x86_64, aarch64]
needs: [get-version]
runs-on: ubuntu-latest
env:
Expand All @@ -97,7 +97,7 @@ jobs:
go-version: ${{ env.GOVERSION }}
- run: |
echo "Building ${{ env.BIN }}"
make GOOS=${{ matrix.go-os }} GOARCH=${{ matrix.go-arch }} build
GOOS=${{ matrix.go-os }} GOARCH=${{ matrix.go-arch }} make build
- uses: actions/upload-artifact@v4.3.1
with:
name: "${{ env.BIN }}"
Expand All @@ -110,7 +110,7 @@ jobs:
fail-fast: false
matrix:
go-os: [darwin]
go-arch: [amd64, arm64]
go-arch: [x86_64, aarch64]
needs: [get-version]
runs-on: macos-latest
env:
Expand All @@ -124,7 +124,7 @@ jobs:
go-version: ${{ env.GOVERSION }}
- run: |
echo "Building ${{ env.BIN }}"
make GOOS=${{ matrix.go-os }} GOARCH=${{ matrix.go-arch }} build
GOOS=${{ matrix.go-os }} GOARCH=${{ matrix.go-arch }} make build
- uses: actions/upload-artifact@v4.3.1
with:
name: "${{ env.BIN }}"
Expand All @@ -137,7 +137,7 @@ jobs:
fail-fast: false
matrix:
go-os: [windows]
go-arch: [386, amd64]
go-arch: [i386, x86_64]
needs: [get-version]
runs-on: ubuntu-latest
env:
Expand All @@ -156,7 +156,7 @@ jobs:
cp -rp packaging/windows/winres .
./tools/go-winres make --arch 386,amd64,arm64
cp rsrc_windows*.syso cmd/snclient/
make GOOS=${{ matrix.go-os }} GOARCH=${{ matrix.go-arch }} build
GOOS=${{ matrix.go-os }} GOARCH=${{ matrix.go-arch }} make build
mv snclient snclient.exe
- uses: actions/upload-artifact@v4.3.1
with:
Expand All @@ -170,7 +170,7 @@ jobs:
fail-fast: false
matrix:
go-os: [windows]
go-arch: [386, amd64]
go-arch: [i386, x86_64]
needs: [get-version, build-win]
runs-on: windows-latest
env:
Expand Down Expand Up @@ -232,7 +232,7 @@ jobs:
strategy:
matrix:
go-os: [windows]
go-arch: [386, amd64]
go-arch: [i386, x86_64]
needs: [get-version, build-win, dist-win, sign-win]
runs-on: windows-latest
env:
Expand Down Expand Up @@ -289,7 +289,7 @@ jobs:
strategy:
matrix:
go-os: [linux]
go-arch: [386, amd64, arm64]
go-arch: [i386, x86_64, aarch64]
runs-on: ubuntu-latest
needs: [get-version, build]
env:
Expand All @@ -305,7 +305,7 @@ jobs:
echo "Building ${{ env.BIN }}.deb"
export DEBEMAIL="Sven Nierlein <sven.nierlein@consol.de>"
export DEBFULLNAME="Sven Nierlein"
make VERSION=${{needs.get-version.outputs.version}} ARCH=${{ matrix.go-arch }} DEBFILE=${{ env.BIN }}.deb deb
ARCH=${{ matrix.go-arch }} make VERSION=${{needs.get-version.outputs.version}} DEBFILE=${{ env.BIN }}.deb deb
- uses: actions/upload-artifact@v4.3.1
with:
name: "${{ env.BIN }}.deb"
Expand All @@ -317,7 +317,7 @@ jobs:
strategy:
matrix:
go-os: [darwin]
go-arch: [amd64, arm64]
go-arch: [x86_64, aarch64]
runs-on: macos-latest
needs: [get-version, build-osx]
env:
Expand Down Expand Up @@ -350,7 +350,7 @@ jobs:
strategy:
matrix:
go-os: [linux]
go-arch: [386, amd64, arm64]
go-arch: [i386, x86_64, aarch64]
runs-on: ubuntu-latest
needs: [get-version, build]
env:
Expand All @@ -366,7 +366,7 @@ jobs:
- run: sudo apt-get install help2man
- run: |
echo "Building ${{ env.BIN }}.rpm"
make rpm
ARCH=${{ matrix.go-arch }} make rpm
mv snclient*.rpm ${{ env.BIN }}.rpm
- uses: actions/upload-artifact@v4.3.1
with:
Expand All @@ -380,7 +380,7 @@ jobs:
strategy:
matrix:
go-os: [linux]
go-arch: [386, amd64, arm64]
go-arch: [i386, x86_64, aarch64]
runs-on: ubuntu-latest
needs: [get-version,pkg-rpm,pkg-deb]
env:
Expand Down Expand Up @@ -423,7 +423,7 @@ jobs:
strategy:
matrix:
go-os: [windows]
go-arch: [amd64]
go-arch: [x86_64]
runs-on: windows-latest
needs: [get-version,pkg-msi]
env:
Expand All @@ -447,7 +447,7 @@ jobs:
- name: "Windows Integration Tests"
run: |
Move-Item -Path ${{ env.BIN }}.msi -Destination .\t\snclient.msi
Copy-Item .\windist\windows_exporter-${{ matrix.go-arch }}.exe .\windist\windows_exporter.exe
Copy-Item .\windist\windows_exporter-amd64.exe .\windist\windows_exporter.exe
cd t
go test -v ; if ($LASTEXITCODE -ne 0) { exit 1 }
shell: powershell
Expand All @@ -466,7 +466,7 @@ jobs:
strategy:
matrix:
go-os: [windows]
go-arch: [386, amd64]
go-arch: [i386, x86_64]
needs: [get-version, integration-test-windows]
runs-on: windows-latest
env:
Expand Down Expand Up @@ -499,7 +499,7 @@ jobs:
strategy:
matrix:
go-os: [windows]
go-arch: [386, amd64]
go-arch: [i386, x86_64]
runs-on: ubuntu-latest
needs: [get-version,make-release]
env:
Expand All @@ -518,7 +518,7 @@ jobs:
strategy:
matrix:
go-os: [linux]
go-arch: [386, amd64, arm64]
go-arch: [i386, x86_64, aarch64]
runs-on: ubuntu-latest
needs: [get-version,make-release]
env:
Expand All @@ -537,7 +537,7 @@ jobs:
strategy:
matrix:
go-os: [linux]
go-arch: [386, amd64, arm64]
go-arch: [i386, x86_64, aarch64]
runs-on: ubuntu-latest
needs: [get-version,make-release]
env:
Expand All @@ -556,7 +556,7 @@ jobs:
strategy:
matrix:
go-os: [darwin]
go-arch: [amd64, arm64]
go-arch: [x86_64, aarch64]
runs-on: ubuntu-latest
needs: [get-version,make-release]
env:
Expand All @@ -575,7 +575,7 @@ jobs:
strategy:
matrix:
go-os: [freebsd]
go-arch: [386, amd64, arm64]
go-arch: [i386, x86_64, aarch64]
runs-on: ubuntu-latest
needs: [get-version,make-release]
env:
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ ifeq ($(RPM_ARCH),arm64)
RPM_ARCH=aarch64
endif

ifeq ($(GOARCH),i386)
export GOARCH := 386
endif
ifeq ($(GOARCH),x86_64)
export GOARCH := amd64
endif
ifeq ($(GOARCH),aarch64)
export GOARCH := arm64
endif

BUILD_FLAGS=-ldflags "-s -w -X pkg/snclient.Build=$(BUILD) -X pkg/snclient.Revision=$(REVISION)"
TEST_FLAGS=-timeout=5m $(BUILD_FLAGS)

Expand Down
6 changes: 4 additions & 2 deletions packaging/windows/build_msi.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ If (-Not (Test-Path -Path "C:\Program Files (x86)\WiX Toolset v3.14\bin\candle.e
}

$win_arch = "$arch"
if ("$arch" -eq "386") { $win_arch = "x86" }
if ("$arch" -eq "amd64") { $win_arch = "x64" }
if ("$arch" -eq "386") { $win_arch = "x86" }
if ("$arch" -eq "i386") { $win_arch = "x86" }
if ("$arch" -eq "amd64") { $win_arch = "x64" }
if ("$arch" -eq "x86_64") { $win_arch = "x64" }

& 'C:\Program Files (x86)\WiX Toolset v3.14\bin\candle.exe' .\packaging\windows\snclient.wxs `
-arch $win_arch `
Expand Down

0 comments on commit 6477498

Please sign in to comment.