diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index ff4f6fc..4c58ec7 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -42,13 +42,13 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - - name: Build binary - run: script/build - name: Setup Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '2.7' bundler-cache: true + - name: Build binary + run: rake build - name: Install ZSH on ubuntu if: matrix.os == 'ubuntu-latest' run: sudo apt-get -y install zsh diff --git a/Rakefile b/Rakefile index ec78759..3888f4f 100644 --- a/Rakefile +++ b/Rakefile @@ -1,19 +1,11 @@ require 'rake/clean' +CLEAN.include FileList.new("tmp/*") # aruba's default tmp directory is local -# aruba's default tmp directory is local -CLEAN.include FileList.new("tmp/*") - -# runs the generate script, which will bootstrap anything it needs in script -desc "generates bindata files" -task :generate do - sh "go generate ./..." -end - -# the unix build script does not force `generate` as prereq, but the task here -# does since we want to always make sure to be up to date with any changes made desc "builds the binary" -task :build => :generate do - sh "script/build" +task :build do + # note starting in go1.18 this information will be available via go version -m + version = `git describe --tags HEAD` + sh "go", "build", "-o", "bin/scmpuff", "-ldflags", "-X main.VERSION=#{version}" end desc "builds & installs the binary to $GOPATH/bin" diff --git a/main.go b/main.go index c4286f1..fb3cb90 100644 --- a/main.go +++ b/main.go @@ -17,7 +17,7 @@ var NAME = "scmpuff" // VERSION is the default version of the program // ...in almost all cases this should be overriden by the buildscript. -var VERSION = "0.?.? (not using buildscript)" +var VERSION = "0.0.0-development" var puffCmd = &cobra.Command{ Use: "scmpuff", diff --git a/script/build b/script/build deleted file mode 100755 index 0ba33e4..0000000 --- a/script/build +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -# Usage: build -# -# Run go build without dependencies. -set -ex - -VERSION="$(git describe --tags HEAD)" -go build -o bin/scmpuff -ldflags "-X main.VERSION=${VERSION}" diff --git a/script/build.bat b/script/build.bat deleted file mode 100644 index b5174a0..0000000 --- a/script/build.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -bash script\build %*