Skip to content

Commit

Permalink
Merge pull request #154 from WillAbides/no-goenv
Browse files Browse the repository at this point in the history
no goenv
  • Loading branch information
WillAbides authored May 29, 2023
2 parents f0e803f + 6e1a44c commit ba7806c
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 123 deletions.
19 changes: 1 addition & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,9 @@ jobs:
${{ steps.setup-go.outputs.GOCACHE }}
${{ steps.setup-go.outputs.GOMODCACHE }}
.bindown
key: ${{ runner.os }}-go-lint-${{ hashFiles('**/go.sum', 'bindown.yml', 'Makefile', 'script/*') }}
key: ${{ runner.os }}-go-lint-${{ hashFiles('**/go.sum', 'bindown.yml', 'script/*') }}
restore-keys: ${{ runner.os }}-go-lint
- run: script/lint
make-bindown:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: WillAbides/setup-go-faster@v1
id: setup-go
with:
go-version: '1.20.x'
- uses: actions/cache@v3
with:
path: |
${{ steps.setup-go.outputs.GOCACHE }}
${{ steps.setup-go.outputs.GOMODCACHE }}
key: ${{ runner.os }}-go-make-bindown-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-make-bindown
- run: make bin/bindown
generate:
runs-on: ubuntu-20.04
steps:
Expand All @@ -80,7 +64,6 @@ jobs:
needs:
- test
- lint
- make-bindown
- generate
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
env:
Expand Down
73 changes: 0 additions & 73 deletions Makefile

This file was deleted.

9 changes: 4 additions & 5 deletions internal/build-bootstrapper/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ import (
var assets embed.FS

func execBindown(repoRoot string, arg ...string) error {
bindownPath := filepath.FromSlash("bin/bootstrapped/bindown")
makeCmd := exec.Command("make", bindownPath)
makeCmd.Dir = repoRoot
err := makeCmd.Run()
bootstrapCmd := exec.Command("script/bootstrap-bindown.sh", "-b", "bin/bootstrapped")
bootstrapCmd.Dir = repoRoot
err := bootstrapCmd.Run()
if err != nil {
return err
}
bindownCmd := exec.Command(bindownPath, arg...)
bindownCmd := exec.Command("bin/bootstrapped/bindown", arg...)
bindownCmd.Dir = repoRoot
return bindownCmd.Run()
}
Expand Down
4 changes: 2 additions & 2 deletions script/bindown
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ set -e

CDPATH="" cd -- "$(dirname -- "$(dirname -- "$0")")"

make -s bin/bindown
go build -o bin/bindown ./cmd/bindown

bin/bindown "$@"
exec bin/bindown "$@"
4 changes: 1 addition & 3 deletions script/fmt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ set -e

CDPATH="" cd -- "$(dirname -- "$(dirname -- "$0")")"

. script/goenv

make -s bin/gofumpt bin/shfmt
script/bindown -q install gofumpt shfmt

bin/gofumpt -w internal/*/*.go cmd/*/*.go

Expand Down
2 changes: 0 additions & 2 deletions script/generate
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ if [ "$1" = "--check" ]; then
exit 0
fi

. script/goenv

script/generate-jsonschema

go generate ./...
Expand Down
4 changes: 1 addition & 3 deletions script/generate-jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ set -e

CDPATH="" cd -- "$(dirname -- "$(dirname -- "$0")")"

. script/goenv

make -s bin/yq
script/bindown -q install yq

go run ./internal/genjsonschema > bindown.schema.json
cp bindown.schema.json ./internal/bindown/bindown.schema.json
Expand Down
13 changes: 0 additions & 13 deletions script/goenv

This file was deleted.

4 changes: 1 addition & 3 deletions script/lint
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ set -e

CDPATH="" cd -- "$(dirname -- "$(dirname -- "$0")")"

. script/goenv

make -s bin/golangci-lint bin/shellcheck
script/bindown -q install golangci-lint shellcheck

bin/golangci-lint run
# Don't check bootstrap-bindown.sh because it's dynamically generated
Expand Down
2 changes: 1 addition & 1 deletion script/release
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ git fetch --tags
bin/goreleaser release --clean

# create bootstrap-bindown.sh
go run ./internal/build-bootstrapper -tag "v$NEXT_VERSION" >bootstrap-bindown.sh
go run ./internal/build-bootstrapper -tag "v$NEXT_VERSION" > bootstrap-bindown.sh
bin/gh release upload "v$NEXT_VERSION" bootstrap-bindown.sh

0 comments on commit ba7806c

Please sign in to comment.