Skip to content

Commit

Permalink
build: deprecate shell buildscript
Browse files Browse the repository at this point in the history
Let the Rakefile handle builds for Ruby integration environment, and
everything else (goreleaser, homebrew) should be already just passing
the needed arguments.
  • Loading branch information
mroth committed Dec 8, 2021
1 parent eacc8bd commit 0c18592
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 5 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 0 additions & 8 deletions script/build

This file was deleted.

3 changes: 0 additions & 3 deletions script/build.bat

This file was deleted.

0 comments on commit 0c18592

Please sign in to comment.