Skip to content

Commit

Permalink
Merge pull request #6080 from mysteriumnetwork/fix-go-build
Browse files Browse the repository at this point in the history
Restore CI build workflow
  • Loading branch information
tzununbekov authored Oct 21, 2024
2 parents 182aa3d + c3f3649 commit d18a229
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 58 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down Expand Up @@ -106,10 +102,6 @@ jobs:
- PackageAndroidProvider

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
Expand All @@ -136,10 +128,6 @@ jobs:
needs: [setup-env, build-packages]

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
Expand Down Expand Up @@ -177,10 +165,6 @@ jobs:
(github.ref == 'refs/heads/master' || github.ref_type == 'tag')
steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ jobs:
NIGHTLY_BUILD: true

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
Expand Down Expand Up @@ -59,10 +55,6 @@ jobs:
- ReleaseDebianPPASnapshot

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
Expand Down Expand Up @@ -112,10 +104,6 @@ jobs:
- ReleaseAndroidProviderSDK

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
Expand Down Expand Up @@ -152,10 +140,6 @@ jobs:
needs: [release-tag]

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/tests-and-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
Expand Down Expand Up @@ -41,10 +37,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
Expand All @@ -67,10 +59,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
Expand Down
10 changes: 5 additions & 5 deletions bin/builder_docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ RUN apt-get update \
&& gem install fpm -v 1.12.0

# Install development dependencies
RUN GO111MODULE=off go get \
github.com/debber/debber-v0.3/cmd/debber \
golang.org/x/lint/golint \
golang.org/x/tools/cmd/goimports \
github.com/go-swagger/go-swagger/cmd/swagger
RUN go install \
github.com/debber/debber-v0.3/cmd/debber@latest \
golang.org/x/lint/golint@latest \
golang.org/x/tools/cmd/goimports@latest \
github.com/go-swagger/go-swagger/cmd/swagger@latest

WORKDIR /go/src/github.com/mysteriumnetwork/node

Expand Down
4 changes: 2 additions & 2 deletions ci/packages/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func GenerateProtobuf() error {
func GetProtobuf() error {
err := sh.RunV("go", "install", "google.golang.org/protobuf/cmd/[email protected]")
if err != nil {
fmt.Println("could not go get 'protoc-gen-go'")
fmt.Println("could not go install 'protoc-gen-go'")
return err
}
return nil
Expand Down Expand Up @@ -88,7 +88,7 @@ func GenerateDocs() error {
func GetSwagger() error {
err := sh.RunV("go", "install", "github.com/go-swagger/go-swagger/cmd/[email protected]")
if err != nil {
fmt.Println("could not go get swagger")
fmt.Println("could not go install swagger")
return err
}
return nil
Expand Down
12 changes: 6 additions & 6 deletions ci/packages/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func PackageLinuxArmv6l() error {
// PackageLinuxDebianAmd64 builds and stores debian amd64 package
func PackageLinuxDebianAmd64() error {
logconfig.Bootstrap()
if err := goGet("github.com/debber/debber-v0.3/cmd/debber"); err != nil {
if err := goInstall("github.com/debber/debber-v0.3/cmd/debber@latest"); err != nil {
return err
}
envi := map[string]string{
Expand All @@ -88,7 +88,7 @@ func PackageLinuxDebianAmd64() error {
// PackageLinuxDebianArm builds and stores debian armv7l+ package
func PackageLinuxDebianArm() error {
logconfig.Bootstrap()
if err := goGet("github.com/debber/debber-v0.3/cmd/debber"); err != nil {
if err := goInstall("github.com/debber/debber-v0.3/cmd/debber@latest"); err != nil {
return err
}
envi := map[string]string{
Expand All @@ -107,7 +107,7 @@ func PackageLinuxDebianArm() error {
// PackageLinuxDebianArmv6l builds and stores debian armv6l package
func PackageLinuxDebianArmv6l() error {
logconfig.Bootstrap()
if err := goGet("github.com/debber/debber-v0.3/cmd/debber"); err != nil {
if err := goInstall("github.com/debber/debber-v0.3/cmd/debber@latest"); err != nil {
return err
}
envi := map[string]string{
Expand All @@ -127,7 +127,7 @@ func PackageLinuxDebianArmv6l() error {
// PackageLinuxDebianArm64 builds and stores debian arm64 package
func PackageLinuxDebianArm64() error {
logconfig.Bootstrap()
if err := goGet("github.com/debber/debber-v0.3/cmd/debber"); err != nil {
if err := goInstall("github.com/debber/debber-v0.3/cmd/debber@latest"); err != nil {
return err
}
envi := map[string]string{
Expand Down Expand Up @@ -369,8 +369,8 @@ func PackageDockerSwaggerRedoc() error {
})
}

func goGet(pkg string) error {
return sh.RunWith(map[string]string{"GO111MODULE": "off"}, "go", "get", "-u", pkg)
func goInstall(pkg string) error {
return sh.Run("go", "install", pkg)
}

func packageStandalone(binaryPath, os, arch string, extraEnvs map[string]string) error {
Expand Down
2 changes: 1 addition & 1 deletion ci/packages/raspberry.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func PackageLinuxRaspberryImage() error {
})
logconfig.Bootstrap()

if err := goGet("github.com/debber/debber-v0.3/cmd/debber"); err != nil {
if err := goInstall("github.com/debber/debber-v0.3/cmd/debber@latest"); err != nil {
return err
}
if err := shell.NewCmd("bin/build_xgo linux/arm").Run(); err != nil {
Expand Down

0 comments on commit d18a229

Please sign in to comment.