Skip to content

Commit

Permalink
The first official server release
Browse files Browse the repository at this point in the history
  • Loading branch information
asjdf authored Apr 12, 2023
2 parents e0c6869 + 0b6bfd6 commit 4af9aeb
Show file tree
Hide file tree
Showing 114 changed files with 6,207 additions and 1,275 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: DockerBuildCheck

on:
pull_request

jobs:
build-base:
name: Build Base
runs-on: ubuntu-latest
steps:
- 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: Build
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: false
23 changes: 23 additions & 0 deletions .github/workflows/depbot-auto-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Dependabot auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
46 changes: 46 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release
on:
push:
branches:
- main
tags-ignore:
- '**'
# pull_request:
# branches:
# - '**'
workflow_dispatch:

jobs:
# test:
# runs-on: ubuntu-22.04
# strategy:
# matrix:
# go: ['1.17', '1.18', '1.19']
# name: Go ${{ matrix.go }} test
# steps:
# - uses: actions/checkout@v3
# - name: Setup go
# uses: actions/setup-go@v3
# with:
# go-version: ${{ matrix.go }}
# - run: go test -race -v -coverprofile=profile.cov ./pkg/...
# - uses: codecov/[email protected]
# with:
# file: ./profile.cov
# name: codecov-go
release:
runs-on: ubuntu-22.04
# needs: [test]
# if: ${{ github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Source checkout
uses: actions/checkout@v3
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
with:
dry_run: false
semantic_version: 18.0.1
extra_plugins: |
@semantic-release/[email protected]
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
*.log
.idea
*test.go
config/config.yaml
*config.yaml
scripts/k8s/config/*
8 changes: 8 additions & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
branches: ["main", {name: 'alpha', prerelease: true}, {name: 'beta', prerelease: true}],
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
};
19 changes: 10 additions & 9 deletions cmd/config/config.go
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
package config

import (
"fmt"
"github.com/spf13/cobra"
"supreme-flamego/config"
"os"
"supreme-flamego/conf"
)

var (
configYml string
forceGen bool
StartCmd = &cobra.Command{
configPath string
forceGen bool
StartCmd = &cobra.Command{
Use: "config",
Short: "Generate config file",
Example: "app config -p config/config.yaml -f",
Example: "mod config -p ./config.yaml -f",
Run: func(cmd *cobra.Command, args []string) {
println("Generate config...")
fmt.Println("Generating config...")
err := load()
if err != nil {
println(err.Error())
fmt.Println(err.Error())
os.Exit(1)
}
},
}
)

func init() {
StartCmd.PersistentFlags().StringVarP(&configYml, "path", "p", "config/config.yaml", "Generate config in provided path")
StartCmd.PersistentFlags().StringVarP(&configPath, "path", "p", "./config.yaml", "Generate config in provided path")
StartCmd.PersistentFlags().BoolVarP(&forceGen, "force", "f", false, "Force generate config in provided path")
}

func load() error {
return config.GenConfig(configYml, forceGen)
return conf.GenYamlConfig(configPath, forceGen)
}
142 changes: 0 additions & 142 deletions cmd/create/createApp.go

This file was deleted.

Loading

0 comments on commit 4af9aeb

Please sign in to comment.