From fb3d15c414c560ec47f570b795698aa5e8284a34 Mon Sep 17 00:00:00 2001 From: Wolfgang Welz Date: Mon, 27 Jul 2020 12:12:36 +0200 Subject: [PATCH] Use GoReleaser to build cli-wallet (#674) * build cli-wallet with goreleaser * remove cli-wallet build script * use plain goreleaser as cgo is not required --- .github/workflows/release.yml | 15 +-- .goreleaser.yml | 197 +++++++++++++++++----------------- tools/cli-wallet/build.sh | 12 --- 3 files changed, 107 insertions(+), 117 deletions(-) delete mode 100755 tools/cli-wallet/build.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f69e06007f..4c8b547c33 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,17 +8,20 @@ jobs: name: GoReleaser runs-on: - ubuntu-latest - container: - image: 'iotmod/goreleaser-cgo-cross-compiler:1.14.4' - volumes: - - /repo steps: - name: Checkout uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 - name: Copy config.default.json to config.json run: cp config.default.json config.json - - name: Release GoShimmer - run: goreleaser --rm-dist + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist env: GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' docker: diff --git a/.goreleaser.yml b/.goreleaser.yml index d2686e2681..e33f0b43b0 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,99 +1,98 @@ -# Documentation at http://goreleaser.com - -# Project name -project_name: GoShimmer - -# Environment variables -env: - - GO111MODULE=on - -# Builds -builds: - # macOS AMD64 - - id: goshimmer-darwin-amd64 - binary: goshimmer - env: - - CGO_ENABLED=0 - ldflags: - - -s -w -X github.com/iotaledger/goshimmer/plugins/cli.AppVersion={{.Version}} - main: main.go - goos: - - darwin - goarch: - - amd64 - # Linux AMD64 - - id: goshimmer-linux-amd64 - binary: goshimmer - env: - - CGO_ENABLED=1 - ldflags: - - -s -w -X github.com/iotaledger/goshimmer/plugins/cli.AppVersion={{.Version}} - flags: - - -tags=pow_avx - main: main.go - goos: - - linux - goarch: - - amd64 - # Windows AMD64 - - id: goshimmer-windows-amd64 - binary: goshimmer - env: - - CGO_ENABLED=1 - - CC=x86_64-w64-mingw32-gcc - - CXX=x86_64-w64-mingw32-g++ - ldflags: - - -s -w -X github.com/iotaledger/goshimmer/plugins/cli.AppVersion={{.Version}} - flags: - - -tags=pow_avx - main: main.go - goos: - - windows - goarch: - - amd64 - -# Archives -archives: - - format: tar.gz - wrap_in_directory: true - format_overrides: - - goos: windows - format: zip - name_template: "{{.ProjectName}}-{{.Version}}_{{.Os}}_{{.Arch}}" - replacements: - amd64: x86_64 - 386: 32bit - arm: ARM - arm64: ARM64 - darwin: macOS - linux: Linux - windows: Windows - openbsd: OpenBSD - netbsd: NetBSD - freebsd: FreeBSD - dragonfly: DragonFlyBSD - files: - - README.md - - LICENSE - - config.json - - snapshot.bin - -# Checksum -checksum: - name_template: "checksums.txt" - -# Snapshot -snapshot: - name_template: "{{ .Tag }}" - -# Changelog -changelog: - skip: true - -# Release -release: - prerelease: auto - name_template: "{{.ProjectName}}-{{.Version}}" - github: - owner: iotaledger - name: goshimmer \ No newline at end of file +# Documentation at http://goreleaser.com + +# Project name +project_name: GoShimmer + +# Environment variables +env: + - GO111MODULE=on + +# Builds +builds: + # GoShimmer AMD64 all OS + - id: goshimmer + binary: goshimmer + env: + - CGO_ENABLED=0 + ldflags: + - -s -w -X github.com/iotaledger/goshimmer/plugins/banner.AppVersion={{.Version}} + goos: + - linux + - darwin + - windows + goarch: + - amd64 + + # cli-wallet AMD64 all OS + - id: cli-wallet + dir: ./tools/cli-wallet + binary: cli-wallet + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + goarch: + - amd64 + +# Archives +archives: + # GoShimmer with config and snapshot + - id: goshimmer + builds: + - goshimmer + name_template: "goshimmer-{{.Version}}_{{.Os}}_{{.Arch}}" + replacements: + amd64: x86_64 + arm: ARM + arm64: ARM64 + darwin: macOS + linux: Linux + windows: Windows + format_overrides: + - goos: windows + format: zip + files: + - README.md + - LICENSE + - config.json + - snapshot.bin + + # cli-wallet + - id: cli-wallet + builds: + - cli-wallet + name_template: "cli-wallet-{{.Version}}_{{.Os}}_{{.Arch}}" + replacements: + amd64: x86_64 + arm: ARM + arm64: ARM64 + darwin: macOS + linux: Linux + windows: Windows + format_overrides: + - goos: windows + format: zip + files: + - LICENSE + +# Checksum +checksum: + name_template: "checksums.txt" + +# Snapshot +snapshot: + name_template: "{{ .Tag }}" + +# Changelog +changelog: + skip: true + +# Release +release: + prerelease: auto + name_template: "{{.ProjectName}}-{{.Version}}" + github: + owner: iotaledger + name: goshimmer diff --git a/tools/cli-wallet/build.sh b/tools/cli-wallet/build.sh deleted file mode 100755 index 09d5182a75..0000000000 --- a/tools/cli-wallet/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -echo "Building executables..." - -GOOS=windows GOARCH=amd64 go build -o cli-wallet_Windows_x86_64.exe -echo "Windows version created" -GOOS=linux GOARCH=amd64 go build -o cli-wallet_Linux_x86_64 -echo "Linux version created" -GOOS=darwin GOARCH=amd64 go build -o cli-wallet_macOS_x86_64 -echo "MAC OSX version created" - -echo "All done!" \ No newline at end of file