Skip to content

Commit c9d4603

Browse files
committed
complete minit
0 parents  commit c9d4603

File tree

463 files changed

+273630
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

463 files changed

+273630
-0
lines changed

.github/workflows/release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: release
2+
3+
on:
4+
workflow_dispatch: { }
5+
push:
6+
branches: [ "main" ]
7+
tags: [ "v*.*.*" ]
8+
9+
env:
10+
DOCKERHUB_USERNAME: guoyk
11+
DOCKERHUB_IMAGE_NAME: guoyk/minit
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
19+
id-token: write
20+
21+
steps:
22+
- name: checkout
23+
uses: actions/checkout@v3
24+
with:
25+
submodules: recursive
26+
27+
- name: docker-setup
28+
uses: docker/setup-buildx-action@v2
29+
30+
- name: docker-login-ghcr
31+
uses: docker/login-action@v2
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: docker-login-dockerhub
38+
uses: docker/login-action@v2
39+
with:
40+
username: ${{ env.DOCKERHUB_USERNAME }}
41+
password: ${{ secrets.DOCKERHUB_TOKEN }}
42+
43+
- name: docker-meta
44+
id: meta
45+
uses: docker/metadata-action@v4
46+
with:
47+
images: |-
48+
ghcr.io/${{ github.repository }}
49+
${{env.DOCKERHUB_IMAGE_NAME}}
50+
tags: |-
51+
type=raw,value=latest,enable={{is_default_branch}}
52+
type=semver,pattern={{version}}
53+
type=semver,pattern={{major}}.{{minor}}
54+
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
55+
56+
- name: docker-build-and-push
57+
uses: docker/build-push-action@v3
58+
with:
59+
context: .
60+
cache-from: type=gha
61+
cache-to: type=gha,mode=max
62+
pull: true
63+
push: true
64+
tags: ${{ steps.meta.outputs.tags }}
65+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
# vendor/
16+
17+
# GoLand
18+
.idea/
19+
20+
# Binary
21+
/minit
22+
23+
# Log
24+
*.log
25+
26+
# macOS
27+
.DS_Store
28+
._*

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM golang:1.19 AS builder
2+
ENV CGO_ENABLED 0
3+
ARG VERSION
4+
WORKDIR /go/src/app
5+
ADD . .
6+
RUN go build -mod vendor -ldflags="-X main.GitHash=$(git rev-parse --short HEAD)" -o /minit
7+
8+
FROM busybox
9+
COPY --from=builder /minit /minit
10+
ENTRYPOINT ["/minit"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 GUO YANKE
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)