Skip to content

Commit

Permalink
re-structure project (#2)
Browse files Browse the repository at this point in the history
* re-org project structure
* debug ci
* fix code
* add goreleaser
* update doc & ci
* fix docker daemon
  • Loading branch information
haobibo authored Sep 14, 2024
1 parent c2cae38 commit 859b018
Show file tree
Hide file tree
Showing 129 changed files with 335 additions and 1,084 deletions.
11 changes: 6 additions & 5 deletions .goreleaser.yml → .github/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ env:

before:
hooks:
- go generate ./...
- go mod download
- go mod tidy

builds:

- id: dynamic
binary: supervisord
env:
Expand Down Expand Up @@ -90,10 +88,13 @@ archives:
files:
- none*

snapshot:
name_template: "{{ incpatch .Version }}-next"

release:
github:
owner: ochinchina
owner: QPod
name: supervisord
draft: false
draft: true
prerelease: auto
name_template: "{{.ProjectName}}-v{{.Version}}"
57 changes: 44 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,57 @@
---
name: CI

on:
push:
branches: [ "master" ]
branches: [ main ]
paths-ignore:
- "*.md"

pull_request:
branches: [ "master" ]
branches: [ main ]
paths-ignore:
- "*.md"

jobs:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

build:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILDKIT_PROGRESS: "plain" # Full logs for CI build.
REGISTRY_URL: "docker.io" # docker.io or other target registry URL: where to push images to.
REGISTRY_SRC: "docker.io" # For BASE_NAMESPACE of images: where to pull base images from.
# DOCKER_REGISTRY_USERNAME and DOCKER_REGISTRY_PASSWORD is required for docker image push, they should be set in CI secrets.
DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
# used to sync image to mirror registry
DOCKER_MIRROR_REGISTRY_USERNAME: ${{ secrets.DOCKER_MIRROR_REGISTRY_USERNAME }}
DOCKER_MIRROR_REGISTRY_PASSWORD: ${{ secrets.DOCKER_MIRROR_REGISTRY_PASSWORD }}

jobs:
build_docker_image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.18
go-version: 1.22
- uses: actions/checkout@v4

- name: Build
run: go build -v ./...
- name: Build Docker
run: |
source ./tool.sh && build_image supervisord latest src/supervisord.Dockerfile && push_image
- name: Test
run: go test -v ./...
build_binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Binary
run: |
set -eux
pwd && ls -alh *
cd src/supervisord
go mod tidy
go test -v
go build -v -o ../../build/
cd ../../
mv src/etc src/webgui ./build/
ls -alh build
46 changes: 0 additions & 46 deletions .github/workflows/release_binaries.yml

This file was deleted.

20 changes: 16 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
.idea
supervisord
supervisord.exe
.vscode

build/
logs
data
pkg/
tmp/
dist
upload
node_modules/
.next/

go.sum
test.log*
.tags*
debug
go-debug.json
vendor
supervisord_linux_amd64
upx
dist
*.exe
*.db
*.db-journal
14 changes: 0 additions & 14 deletions Dockerfile

This file was deleted.

25 changes: 0 additions & 25 deletions Dockerfile.github

This file was deleted.

Loading

0 comments on commit 859b018

Please sign in to comment.