Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,5 @@ APP_NAME=Goravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_HOST=127.0.0.1
APP_PORT=3000

LOG_CHANNEL=stack
LOG_LEVEL=debug

GITHUB_TOKEN=
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ FROM alpine:latest
WORKDIR /www

COPY --from=builder /build/main /www/
COPY --from=builder /build/public/ /www/public/
COPY --from=builder /build/storage/ /www/storage/
COPY --from=builder /build/resources/ /www/resources/
COPY --from=builder /build/.env /www/.env

ENTRYPOINT ["/www/main"]
68 changes: 66 additions & 2 deletions app/console/commands/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
"strings"
"sync"

"github.com/google/go-github/v73/github"
"github.com/google/go-github/v81/github"
"github.com/goravel/framework/contracts/console"
"github.com/goravel/framework/contracts/console/command"
"github.com/goravel/framework/contracts/http/client"
"github.com/goravel/framework/facades"
"github.com/goravel/framework/support/color"
"github.com/goravel/framework/support/convert"

"goravel/app/facades"
"goravel/app/services"
)

Expand Down Expand Up @@ -114,6 +114,10 @@ func (r *Release) Handle(ctx console.Context) error {
return r.releasePatch(ctx)
}

if ctx.Argument(0) == "preview" {
return r.preview(ctx)
}

return nil
}

Expand Down Expand Up @@ -581,6 +585,66 @@ func (r *Release) isReleaseExist(repo string, tag string) (bool, error) {
return false, nil
}

func (r *Release) preview(ctx console.Context) error {
frameworkTag := ctx.Option("framework")
packageTag := ctx.Option("packages")

var releaseInfos []*ReleaseInformation

if frameworkTag != "" {
goravelReleaseInfo, err := r.getPackageReleaseInformation(ctx, "goravel", frameworkTag)
if err != nil {
return err
}

frameworkReleaseInfo, err := r.getFrameworkReleaseInformation(ctx, frameworkTag)
if err != nil {
return err
}

releaseInfos = append(releaseInfos, goravelReleaseInfo, frameworkReleaseInfo)
}

if packageTag != "" {
packagesReleaseInfo, err := r.getPackagesReleaseInformation(ctx, packageTag)
if err != nil {
return err
}

releaseInfos = append(releaseInfos, packagesReleaseInfo...)
}

for _, releaseInfo := range releaseInfos {
r.divider(ctx)
color.Yellow().Println(fmt.Sprintf("Please check %s/%s information:", owner, releaseInfo.repo))
ctx.NewLine()

color.Black().Print("The latest tag is: ")
color.Red().Println(releaseInfo.latestTag)

color.Black().Print("The tag to release is: ")
color.Red().Println(releaseInfo.tag)

if releaseInfo.currentTag != "" {
color.Black().Print("The current tag in code is: ")
color.Red().Println(releaseInfo.currentTag)

if releaseInfo.currentTag != releaseInfo.tag {
ctx.NewLine()
color.Red().Println("The current tag is not the same as the tag to release")
}
}

ctx.NewLine()
color.Black().Println(releaseInfo.notes.Name)
color.Black().Println(releaseInfo.notes.Body)

ctx.NewLine()
}

return nil
}

func (r *Release) pushBranch(ctx console.Context, repo, branch string) error {
defer func() {
_, _ = r.process.Run(fmt.Sprintf("rm -rf %s", repo))
Expand Down
2 changes: 1 addition & 1 deletion app/console/commands/release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/google/go-github/v73/github"
"github.com/google/go-github/v81/github"
"github.com/goravel/framework/contracts/console"
mocksconsole "github.com/goravel/framework/mocks/console"
mocksclient "github.com/goravel/framework/mocks/http/client"
Expand Down
21 changes: 0 additions & 21 deletions app/console/kernel.go

This file was deleted.

10 changes: 10 additions & 0 deletions app/facades/app.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package facades

import (
contractsfoundation "github.com/goravel/framework/contracts/foundation"
"github.com/goravel/framework/foundation"
)

func App() contractsfoundation.Application {
return foundation.App
}
9 changes: 9 additions & 0 deletions app/facades/artisan.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package facades

import (
"github.com/goravel/framework/contracts/console"
)

func Artisan() console.Artisan {
return App().MakeArtisan()
}
9 changes: 9 additions & 0 deletions app/facades/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package facades

import (
"github.com/goravel/framework/contracts/config"
)

func Config() config.Config {
return App().MakeConfig()
}
9 changes: 9 additions & 0 deletions app/facades/http.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package facades

import (
"github.com/goravel/framework/contracts/http/client"
)

func Http() client.Request {
return App().MakeHttp()
}
Empty file removed app/grpc/controllers/.gitignore
Empty file.
Empty file removed app/grpc/interceptors/.gitignore
Empty file.
19 changes: 0 additions & 19 deletions app/grpc/kernel.go

This file was deleted.

21 changes: 0 additions & 21 deletions app/http/controllers/user_controller.go

This file was deleted.

14 changes: 0 additions & 14 deletions app/http/kernel.go

This file was deleted.

Empty file removed app/http/middleware/.gitignore
Empty file.
2 changes: 1 addition & 1 deletion app/mocks/services/Github.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions app/models/user.go

This file was deleted.

16 changes: 0 additions & 16 deletions app/providers/app_service_provider.go

This file was deleted.

16 changes: 0 additions & 16 deletions app/providers/auth_service_provider.go

This file was deleted.

21 changes: 0 additions & 21 deletions app/providers/console_service_provider.go

This file was deleted.

21 changes: 0 additions & 21 deletions app/providers/database_service_provider.go

This file was deleted.

22 changes: 0 additions & 22 deletions app/providers/event_service_provider.go

This file was deleted.

24 changes: 0 additions & 24 deletions app/providers/grpc_service_provider.go

This file was deleted.

Loading