Add configuration and other related code, and add automatic build related frameworks. Currently, the version is not available
This commit is contained in:
34
.github/workflows/test-and-build.yml
vendored
Normal file
34
.github/workflows/test-and-build.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Test and Build Project
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
build_type:
|
||||||
|
description: "Build type: version or pre"
|
||||||
|
required: true
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- version
|
||||||
|
- pre
|
||||||
|
version_number:
|
||||||
|
description: "Version number"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: self-hosted
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Test code
|
||||||
|
run: |
|
||||||
|
echo "Testing code"
|
||||||
|
- name: Build version
|
||||||
|
if: ${{ github.event.inputs.build_type == 'version' }}
|
||||||
|
run: |
|
||||||
|
echo "Building version ${{ github.event.inputs.version_number }}"
|
||||||
|
go mod tidy
|
||||||
|
- name: Build pre-release
|
||||||
|
if: ${{ github.event.inputs.build_type == 'pre' }}
|
||||||
|
run: |
|
||||||
|
echo "Building pre-release ${{ github.event.inputs.version_number }}"
|
||||||
|
go mod tidy
|
||||||
16
.github/workflows/test-runners.yml
vendored
16
.github/workflows/test-runners.yml
vendored
@@ -1,16 +0,0 @@
|
|||||||
name: Test Runners
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
jobs:
|
|
||||||
test-runners:
|
|
||||||
runs-on: self-hosted
|
|
||||||
steps:
|
|
||||||
- name: test-runners
|
|
||||||
run: |
|
|
||||||
echo "Testing runners..."
|
|
||||||
cat /etc/os-release
|
|
||||||
14
config.example.json
Normal file
14
config.example.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"server": {
|
||||||
|
"host": "0.0.0.0",
|
||||||
|
"port": 2233
|
||||||
|
},
|
||||||
|
"database": {
|
||||||
|
"host": "localhost",
|
||||||
|
"port": 3306,
|
||||||
|
"username": "root",
|
||||||
|
"password": "password",
|
||||||
|
"database": "meowbox",
|
||||||
|
"prefix": "box_"
|
||||||
|
}
|
||||||
|
}
|
||||||
0
internal/service/config.go
Normal file
0
internal/service/config.go
Normal file
17
internal/service/struct.go
Normal file
17
internal/service/struct.go
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package service
|
||||||
|
|
||||||
|
// Config represents the full configuration structure
|
||||||
|
type Config struct {
|
||||||
|
Server struct {
|
||||||
|
Host string `json:"host"`
|
||||||
|
Port int `json:"port"`
|
||||||
|
} `json:"server"`
|
||||||
|
Database struct {
|
||||||
|
Host string `json:"host"`
|
||||||
|
Port int `json:"port"`
|
||||||
|
Username string `json:"username"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
Database string `json:"database"`
|
||||||
|
Prefix string `json:"prefix"`
|
||||||
|
} `json:"database"`
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user