Implement Gorelease and github actions

pull/3/head
Jean-Marc MEESSEN 4 years ago committed by GitHub
parent b4c740180a
commit f344690e26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,30 @@
name: Go Build & Test
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}
name: Build & Test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.14.0'
- run: go mod download
- name: Build & Test
run: |
./update-version.sh
go build -v .
go test ./...
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@master
with:
args: release --snapshot --skip-publish --rm-dist

@ -0,0 +1,22 @@
name: Release with goreleaser
on:
push:
tags:
- v*.*.*
jobs:
build:
runs-on: ubuntu-latest
name: goreleaser
steps:
- uses: actions/checkout@v2
- name: Unshallow Fetch
run: git fetch --prune --unshallow
- uses: actions/setup-go@v2
with:
go-version: '^1.14.0'
- name: Release via goreleaser
uses: goreleaser/goreleaser-action@master
with:
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1
.gitignore vendored

@ -5,7 +5,6 @@
*.so *.so
*.dylib *.dylib
./FLEcli ./FLEcli
#executables/*
test/output/temp/* test/output/temp/*
# Test binary, built with `go test -c` # Test binary, built with `go test -c`

@ -0,0 +1,40 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# Update the version so that it is included in the app
- ./update-version.sh
builds:
- goos:
- linux
- windows
- darwin
ignore:
- goos: darwin
goarch: 386
- goos: windows
goarch: amd64
env:
- CGO_ENABLED=0
archives:
- replacements:
amd64: 64-bit
386: 32-bit
darwin: macOS
linux: Linux
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format_overrides:
- goos: windows
format: zip
files:
- README.md
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

BIN
FLEcli

Binary file not shown.

@ -1,4 +1,4 @@
package cmd package cmd
//VersionString is the version that will be displayed with the -v switch //VersionString is the version that will be displayed with the -v switch
const VersionString = "v0.0.0 (2020-07-16)" const VersionString = "v0.0.0-1-gb4c7401 (2020-07-18)"

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1,18 +0,0 @@
#!/bin/bash
set -e
echo "Testing..."
go test ./...
mkdir -p executables/windows
mkdir -p executables/macos
mkdir -p executables/linux
./update-version.sh
GOOS=windows GOARCH=386 go build -o executables/windows/FLEcli.exe
GOOS=darwin GOARCH=amd64 go build -o executables/macos/FLEcli
GOOS=linux GOARCH=amd64 go build -o executables/linux/FLEcli-amd64
Loading…
Cancel
Save