cross-platform goreleaser; wip (#70)

This commit is contained in:
Michael Quigley 2022-11-03 13:55:22 -04:00
parent 33199b0e93
commit c4ba54f60d
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
4 changed files with 105 additions and 8 deletions

View File

@ -3,10 +3,10 @@ name: Release
on:
push:
tags:
- '*'
- 'v*.*.*'
jobs:
release-build:
build-linux:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install gcc-multilib g++-multilib
@ -38,6 +38,85 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --rm-dist
args: release --skip-publish --config .goreleaser-linux.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: action/upload-artifact@v3
with:
name: zrok-linux
path: dist/zrok*
build-windows:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install gcc-mingw-w64-x86-64
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: '>=1.19.3'
cache: true
- uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm install
working-directory: ui
- run: npm run build
working-directory: ui
env:
CI: ""
- uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --skip-publish --config .goreleaser-windows.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: action/upload-artifact@v3
with:
name: zrok-windows
path: dist/zrok*
publish-release:
needs: [build-linux, build-windows]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
mkdir -p ./zrok-build/linux
mkdir -p ./zrok-build/windows
- uses: actions/download-artifact@v3
with:
name: zrok-linux
path: ./zrok-build/linux
- uses: actions/download-artifact@v3
with:
name: zrok-windows
path: ./zrok-build/windows
- run: |
cd ./zrok-build
cat ./linux/zrok*checksums.txt >> checksums.txt
cat ./windows/zrok*checksums.txt >> checksums.txt
rm ./linux/zrok*checksums.txt
rm ./windows/zrok*checksums.txt
- uses: goreleaser/goreleaser-action@v3
with:
args: release --config .goreleaser-release.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,9 +1,9 @@
builds:
- main: ./cmd/zrok
ldflags: "-s -w -X github.com/openziti-test-kitchen/zrok/build.Version={{.Tag}} -X github.com/openziti-test-kitchen/zrok/build.Hash={{.ShortCommit}}"
ignore:
- goarch: arm
- goarch: arm64
- goos: darwin
env:
- CGO_ENABLED=1
- CGO_ENABLED=1
goos:
- linux
goarch:
- amd64

8
.goreleaser-release.yml Normal file
View File

@ -0,0 +1,8 @@
builds:
- skip: true
release:
draft: true
mode: append
extra_files:
- glob: ./zrok-build/**/*
- glob: ./zrok-build/checksums.txt

10
.goreleaser-windows.yml Normal file
View File

@ -0,0 +1,10 @@
builds:
- main: ./cmd/zrok
ldflags: "-s -w -X github.com/openziti-test-kitchen/zrok/build.Version={{.Tag}} -X github.com/openziti-test-kitchen/zrok/build.Hash={{.ShortCommit}}"
env:
- CGO_ENABLED=1
- CC=/usr/bin/x86_64-w64-mingw32-gcc
goos:
- windows
goarch:
- amd64