Skip to content

Commit

Permalink
fix: github release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
glebiller committed Oct 6, 2022
1 parent 919ac01 commit ad7579b
Show file tree
Hide file tree
Showing 124 changed files with 1,205 additions and 261 deletions.
62 changes: 62 additions & 0 deletions .github/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
project_name: bdjuno
before:
hooks:
- go mod tidy
builds:
- id: "bdjuno"
main: ./cmd/bdjuno/main.go
binary: bdjuno
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
changelog:
skip: false
use: git
groups:
- title: Features
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: 'Bug fixes'
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
- title: Others
order: 999
filters:
exclude:
- '^docs:'
- '^chore:'
dockers:
- use: buildx
goos: linux
goarch: amd64
image_templates:
- "ghcr.io/elesto-dao/{{ .ProjectName }}:{{ .Version }}-amd64"
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- use: buildx
goos: linux
goarch: arm64
image_templates:
- "ghcr.io/elesto-dao/{{ .ProjectName }}:{{ .Version }}-arm64v8"
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
docker_manifests:
- name_template: ghcr.io/elesto-dao/{{ .ProjectName }}:{{ .Version }}
image_templates:
- ghcr.io/elesto-dao/{{ .ProjectName }}:{{ .Version }}-amd64
- ghcr.io/elesto-dao/{{ .ProjectName }}:{{ .Version }}-arm64v8
38 changes: 19 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,43 @@
---
name: Release

on:
pull_request:
push:
branches:
- chains/elesto/*

jobs:
Build-and-Publish:
release:
name: Release
runs-on: ubuntu-latest
steps:
- id: release-please
name: Release Please
uses: google-github-actions/release-please-action@v3
with:
release-type: node
package-name: elesto-issuer-dashboard
release-type: go
package-name: bdjuno
changelog-types: >-
[
{"type":"feat","section":"Features","hidden":false},
{"type":"fix","section":"Bug Fixes","hidden":false},
{"type":"chore","section":"Miscellaneous","hidden":true}
]
- name: Checkout
uses: actions/checkout@v3
if: steps.release-please.outputs.release_created
with:
fetch-depth: 0
- name: Setup ssh-agent
uses: webfactory/[email protected]
if: steps.release-please.outputs.release_created
with:
ssh-private-key: ${{ secrets.ELESTO_DEPLOY_KEY }}
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
if: steps.release-please.outputs.release_created
with:
fetch-depth: 0
go-version-file: go.mod
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: steps.release-please.outputs.release_created
Expand All @@ -45,17 +51,11 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Image metadata
id: meta
uses: docker/metadata-action@v4
if: steps.release-please.outputs.release_created
with:
images: ghcr.io/${{ github.repository }}
tags: type=raw,value=${{ steps.release-please.outputs.tag_name }}
- name: Build and push
uses: docker/build-push-action@v3
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
if: steps.release-please.outputs.release_created
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
args: release --rm-dist --config .github/.goreleaser.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPRIVATE: github.com/${{ env.GITHUB_REPOSITORY_OWNER }}
44 changes: 44 additions & 0 deletions .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on:
pull_request:
push:
branches:
- test

jobs:
Build-and-Publish:
runs-on: ubuntu-latest
steps:
- name: Setup ssh-agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.ELESTO_DEPLOY_KEY }}
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Image metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: type=raw,value=1.0.0
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
ssh: |
default=${{ env.SSH_AUTH_SOCK }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea/
build/
dist/

# Configuration
*.toml
Expand Down
15 changes: 5 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
FROM golang:1.18-alpine AS builder
RUN apk update && apk add --no-cache make git
WORKDIR /go/src/github.com/forbole/bdjuno
COPY . ./
RUN go mod download
RUN make build
FROM scratch

FROM alpine:latest
WORKDIR /bdjuno
COPY --from=builder /go/src/github.com/forbole/bdjuno/build/bdjuno /usr/bin/bdjuno
CMD [ "bdjuno" ]
COPY /bdjuno /bdjuno

ENTRYPOINT [ "/bdjuno" ]
CMD [ "" ]
15 changes: 7 additions & 8 deletions cmd/bdjuno/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@ package main

import (
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/elesto-dao/elesto/v3/app"
"github.com/forbole/juno/v3/cmd"
initcmd "github.com/forbole/juno/v3/cmd/init"
parsetypes "github.com/forbole/juno/v3/cmd/parse/types"
startcmd "github.com/forbole/juno/v3/cmd/start"
"github.com/forbole/juno/v3/modules/messages"

migratecmd "github.com/forbole/bdjuno/v3/cmd/migrate"
parsecmd "github.com/forbole/bdjuno/v3/cmd/parse"
migratecmd "github.com/elesto-dao/bdjuno/cmd/migrate"
parsecmd "github.com/elesto-dao/bdjuno/cmd/parse"

"github.com/forbole/bdjuno/v3/types/config"
"github.com/elesto-dao/bdjuno/types/config"

"github.com/forbole/bdjuno/v3/database"
"github.com/forbole/bdjuno/v3/modules"

gaiaapp "github.com/cosmos/gaia/v7/app"
"github.com/elesto-dao/bdjuno/database"
"github.com/elesto-dao/bdjuno/modules"
)

func main() {
Expand Down Expand Up @@ -55,7 +54,7 @@ func main() {
// This should be edited by custom implementations if needed.
func getBasicManagers() []module.BasicManager {
return []module.BasicManager{
gaiaapp.ModuleBasics,
app.ModuleBasics,
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/migrate/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
parsecmdtypes "github.com/forbole/juno/v3/cmd/parse/types"
"github.com/spf13/cobra"

v3 "github.com/forbole/bdjuno/v3/cmd/migrate/v3"
v3 "github.com/elesto-dao/bdjuno/cmd/migrate/v3"
)

type Migrator func(parseCfg *parsecmdtypes.Config) error
Expand Down
2 changes: 1 addition & 1 deletion cmd/migrate/v3/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"io/ioutil"

"github.com/forbole/bdjuno/v3/modules/actions"
"github.com/elesto-dao/bdjuno/modules/actions"

parsecmdtypes "github.com/forbole/juno/v3/cmd/parse/types"

Expand Down
2 changes: 1 addition & 1 deletion cmd/migrate/v3/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package v3
import (
v3 "github.com/forbole/juno/v3/cmd/migrate/v3"

"github.com/forbole/bdjuno/v3/modules/actions"
"github.com/elesto-dao/bdjuno/modules/actions"
)

type Config struct {
Expand Down
6 changes: 3 additions & 3 deletions cmd/parse/auth/vesting.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"github.com/forbole/juno/v3/types/config"
"github.com/spf13/cobra"

"github.com/forbole/bdjuno/v3/database"
authutils "github.com/forbole/bdjuno/v3/modules/auth"
"github.com/forbole/bdjuno/v3/utils"
"github.com/elesto-dao/bdjuno/database"
authutils "github.com/elesto-dao/bdjuno/modules/auth"
"github.com/elesto-dao/bdjuno/utils"
)

// vestingCmd returns a Cobra command that allows to fix the vesting data for the accounts
Expand Down
6 changes: 3 additions & 3 deletions cmd/parse/feegrant/allowance.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
parsecmdtypes "github.com/forbole/juno/v3/cmd/parse/types"
"github.com/forbole/juno/v3/types/config"

"github.com/forbole/bdjuno/v3/modules/feegrant"
"github.com/forbole/bdjuno/v3/utils"
"github.com/elesto-dao/bdjuno/modules/feegrant"
"github.com/elesto-dao/bdjuno/utils"

"github.com/spf13/cobra"

"github.com/forbole/bdjuno/v3/database"
"github.com/elesto-dao/bdjuno/database"

"sort"

Expand Down
16 changes: 8 additions & 8 deletions cmd/parse/gov/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"strconv"

modulestypes "github.com/forbole/bdjuno/v3/modules/types"
modulestypes "github.com/elesto-dao/bdjuno/modules/types"
"github.com/rs/zerolog/log"

govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
Expand All @@ -15,13 +15,13 @@ import (

"github.com/forbole/juno/v3/parser"

"github.com/forbole/bdjuno/v3/database"
"github.com/forbole/bdjuno/v3/modules/distribution"
"github.com/forbole/bdjuno/v3/modules/gov"
"github.com/forbole/bdjuno/v3/modules/mint"
"github.com/forbole/bdjuno/v3/modules/slashing"
"github.com/forbole/bdjuno/v3/modules/staking"
"github.com/forbole/bdjuno/v3/utils"
"github.com/elesto-dao/bdjuno/database"
"github.com/elesto-dao/bdjuno/modules/distribution"
"github.com/elesto-dao/bdjuno/modules/gov"
"github.com/elesto-dao/bdjuno/modules/mint"
"github.com/elesto-dao/bdjuno/modules/slashing"
"github.com/elesto-dao/bdjuno/modules/staking"
"github.com/elesto-dao/bdjuno/utils"
)

// proposalCmd returns the Cobra command allowing to fix all things related to a proposal
Expand Down
8 changes: 4 additions & 4 deletions cmd/parse/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (

parsegenesis "github.com/forbole/juno/v3/cmd/parse/genesis"

parseauth "github.com/forbole/bdjuno/v3/cmd/parse/auth"
parsefeegrant "github.com/forbole/bdjuno/v3/cmd/parse/feegrant"
parsegov "github.com/forbole/bdjuno/v3/cmd/parse/gov"
parsestaking "github.com/forbole/bdjuno/v3/cmd/parse/staking"
parseauth "github.com/elesto-dao/bdjuno/cmd/parse/auth"
parsefeegrant "github.com/elesto-dao/bdjuno/cmd/parse/feegrant"
parsegov "github.com/elesto-dao/bdjuno/cmd/parse/gov"
parsestaking "github.com/elesto-dao/bdjuno/cmd/parse/staking"
parsetransaction "github.com/forbole/juno/v3/cmd/parse/transactions"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/parse/staking/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package staking
import (
"fmt"

modulestypes "github.com/forbole/bdjuno/v3/modules/types"
modulestypes "github.com/elesto-dao/bdjuno/modules/types"

parsecmdtypes "github.com/forbole/juno/v3/cmd/parse/types"
"github.com/forbole/juno/v3/types/config"
"github.com/spf13/cobra"

"github.com/forbole/bdjuno/v3/database"
"github.com/forbole/bdjuno/v3/modules/staking"
"github.com/elesto-dao/bdjuno/database"
"github.com/elesto-dao/bdjuno/modules/staking"
)

// validatorsCmd returns a Cobra command that allows to fix the validator infos for all validators.
Expand Down
6 changes: 3 additions & 3 deletions database/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"github.com/gogo/protobuf/proto"
"github.com/lib/pq"

dbtypes "github.com/forbole/bdjuno/v3/database/types"
dbutils "github.com/forbole/bdjuno/v3/database/utils"
dbtypes "github.com/elesto-dao/bdjuno/database/types"
dbutils "github.com/elesto-dao/bdjuno/database/utils"

"github.com/forbole/bdjuno/v3/types"
"github.com/elesto-dao/bdjuno/types"
)

// SaveAccounts saves the given accounts inside the database
Expand Down
4 changes: 2 additions & 2 deletions database/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
authttypes "github.com/cosmos/cosmos-sdk/x/auth/types"

"github.com/forbole/bdjuno/v3/types"
"github.com/elesto-dao/bdjuno/types"

dbtypes "github.com/forbole/bdjuno/v3/database/types"
dbtypes "github.com/elesto-dao/bdjuno/database/types"
)

func (suite *DbTestSuite) TestSaveAccount() {
Expand Down
Loading

0 comments on commit ad7579b

Please sign in to comment.