Skip to content

Commit 47b0c99

Browse files
committed
refactor(scaffolding): switch from packr to embed
for embedding scaffolding templates into Starport's binary.
1 parent 9cc965c commit 47b0c99

File tree

26 files changed

+188
-311
lines changed

26 files changed

+188
-311
lines changed

.github/workflows/goreleaser.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,16 @@ jobs:
1515
- name: Set up Go
1616
uses: actions/setup-go@v2
1717
with:
18-
go-version: 1.15
18+
go-version: 1.16
1919

2020
- name: Set up Node
2121
uses: actions/setup-node@v2-beta
2222
with:
23-
node-version: "14"
24-
25-
- name: Set up packr2
26-
run: go get -u github.com/gobuffalo/packr/v2/packr2
23+
node-version: 14
2724

2825
- name: Set up Snapcraft
2926
run: |
3027
sudo apt-get update && sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
31-
3228
- name: Checkout
3329
uses: actions/checkout@v2
3430
with:
@@ -39,20 +35,11 @@ jobs:
3935
working-directory: ${{ env.working-directory }}
4036
run: make ui
4137

42-
- name: Run packr2
43-
working-directory: ${{ env.working-directory }}
44-
run: |
45-
export GOPATH=$GITHUB_WORKSPACE/go
46-
export PATH=$PATH:$GOPATH
47-
cd starport/interface/cli/starport
48-
packr2 -v
49-
5038
- name: Snapcraft Login
5139
env:
5240
SNAPCRAFT_LOGIN: ${{ secrets.SNAPCRAFT_LOGIN }}
5341
run: |
5442
snapcraft login --with <(echo "$SNAPCRAFT_LOGIN")
55-
5643
- name: Run GoReleaser
5744
uses: goreleaser/goreleaser-action@v2
5845
with:

.github/workflows/lint.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ jobs:
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 6
1313
steps:
14+
- name: Set up Go
15+
uses: actions/setup-go@v2
16+
with:
17+
go-version: "1.16"
18+
1419
- uses: actions/checkout@v2
20+
1521
- uses: golangci/golangci-lint-action@master
1622
with:
17-
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
18-
version: v1.28
23+
version: v1.36.0
1924
args: --timeout 10m
2025
github-token: ${{ secrets.github_token }}
21-
26+
skip-go-installation: true

.github/workflows/semantic-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ jobs:
1111
steps:
1212
- uses: amannn/action-semantic-pull-request@v1.2.0
1313
env:
14-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-e2e.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,17 @@ jobs:
1616
- name: Set up Go
1717
uses: actions/setup-go@v2
1818
with:
19-
go-version: 1.15
19+
go-version: 1.16
20+
stable: false
2021

2122
- name: Set up Node
2223
uses: actions/setup-node@v2-beta
2324
with:
24-
node-version: "14"
25+
node-version: 14
2526

2627
- name: Install protoc
2728
uses: arduino/setup-protoc@v1
2829

29-
- name: Set up packr2
30-
run: go get -u github.com/gobuffalo/packr/v2/packr2
31-
3230
- name: Checkout
3331
uses: actions/checkout@v2
3432
with:
@@ -39,14 +37,6 @@ jobs:
3937
working-directory: ${{ env.working-directory }}
4038
run: make ui
4139

42-
- name: Run packr2
43-
working-directory: ${{ env.working-directory }}
44-
run: |
45-
export GOPATH=$GITHUB_WORKSPACE/go
46-
export PATH=$PATH:$GOPATH
47-
cd starport/interface/cli/starport
48-
packr2 -v
49-
5040
- name: Install Starport
5141
working-directory: ${{ env.working-directory }}
5242
run: |

.github/workflows/test-integration.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v2
1919
with:
20-
go-version: 1.15
20+
go-version: "1.16"
21+
22+
- name: "Get Go 1.15"
23+
run: |
24+
go get golang.org/dl/go1.15
25+
go1.15 download
2126
2227
- name: Install protoc
2328
uses: arduino/setup-protoc@v1
2429

25-
- name: Set up packr2
26-
run: go get -u github.com/gobuffalo/packr/v2/packr2
27-
2830
- name: Checkout
2931
uses: actions/checkout@v2
3032
with:
@@ -35,14 +37,6 @@ jobs:
3537
working-directory: ${{ env.working-directory }}
3638
run: make ui
3739

38-
- name: Run packr2
39-
working-directory: ${{ env.working-directory }}
40-
run: |
41-
export GOPATH=$GITHUB_WORKSPACE/go
42-
export PATH=$PATH:$GOPATH
43-
cd starport/interface/cli/starport
44-
packr2 -v
45-
4640
- name: Install Starport
4741
working-directory: ${{ env.working-directory }}
4842
run: |
@@ -51,3 +45,5 @@ jobs:
5145
- name: Run Integration Tests
5246
working-directory: ${{ env.working-directory }}
5347
run: ./scripts/test-integration
48+
env:
49+
GONAME: "go1.15"

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ jobs:
1414
- uses: actions/checkout@v2
1515
- uses: actions/setup-go@v2
1616
with:
17-
go-version: '1.15'
17+
go-version: "1.16"
1818
- run: ./scripts/test-unit

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
build/
22
dist
3-
packrd
4-
*-packr.go
53
node_modules
64
.DS_Store
75
apps/
86
.idea
9-
.vscode
7+
.vscode

.gitpod.Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
FROM gitpod/workspace-full
22

3+
RUN wget https://golang.org/dl/go1.16.linux-amd64.tar.gz && \
4+
rm -rf $HOME/go && \
5+
tar -C $HOME -xzf go1.16.linux-amd64.tar.gz && \
6+
rm go1.16.linux-amd64.tar.gz
7+
8+
ENV GONAME go1.15
9+
310
RUN brew install gh protobuf

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ build-static:
2121
@go-bindata -pkg cosmosfaucet -prefix starport/pkg/cosmosfaucet -o starport/pkg/cosmosfaucet/openapi_generated.go starport/pkg/cosmosfaucet/openapi/...
2222

2323
build: mod pre-build
24-
@go get -u github.com/gobuffalo/packr/v2/packr2
25-
@cd ./starport/interface/cli/starport && packr2
2624
@mkdir -p build/
2725
@go build $(BUILD_FLAGS) -o build/ ./starport/interface/cli/...
28-
@packr2 clean
2926
@go mod tidy
3027

3128
clean:

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/tendermint/starport
22

3-
go 1.15
3+
go 1.16
44

55
require (
66
github.com/AlecAivazis/survey/v2 v2.1.1
@@ -17,7 +17,8 @@ require (
1717
github.com/go-bindata/go-bindata v3.1.2+incompatible
1818
github.com/go-git/go-git/v5 v5.1.0
1919
github.com/gobuffalo/genny v0.6.0
20-
github.com/gobuffalo/packr/v2 v2.8.1
20+
github.com/gobuffalo/packd v1.0.0
21+
github.com/gobuffalo/packr/v2 v2.8.1 // indirect
2122
github.com/gobuffalo/plush v3.8.3+incompatible
2223
github.com/gobuffalo/plushgen v0.1.2
2324
github.com/goccy/go-yaml v1.8.0

0 commit comments

Comments
 (0)