Skip to content

Commit f07db26

Browse files
committed
Merge branch 'main' of github.com:dazz/s6-cli into main
2 parents 241d15b + 9ba7769 commit f07db26

File tree

4 files changed

+62
-9
lines changed

4 files changed

+62
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: ci
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
go-version: [ '1.20', '1.21.x' ]
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Setup Go ${{ matrix.go-version }}
16+
uses: actions/setup-go@v4
17+
with:
18+
go-version: ${{ matrix.go-version }}
19+
- name: Install dependencies
20+
run: go get .
21+
- name: Build
22+
run: go build -v ./...
23+
- name: Test with the Go CLI
24+
run: go test

.github/workflows/release.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: release
2+
3+
on:
4+
create
5+
6+
jobs:
7+
docker:
8+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
9+
runs-on: ubuntu-latest
10+
steps:
11+
-
12+
name: Set up QEMU
13+
uses: docker/setup-qemu-action@v3
14+
-
15+
name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v3
17+
-
18+
name: Login to Docker Hub
19+
uses: docker/login-action@v3
20+
with:
21+
username: ${{ secrets.DOCKERHUB_USERNAME }}
22+
password: ${{ secrets.DOCKERHUB_TOKEN }}
23+
-
24+
name: Build and push
25+
uses: docker/build-push-action@v5
26+
with:
27+
push: true
28+
tags: hakindazz/s6-cli:latest

Dockerfile

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
# Stage 1: Build the Go binary
2-
FROM golang:1.17 AS builder
1+
# build stage
2+
FROM golang:1.20.12-alpine3.19 as builder
3+
4+
ENV GO111MODULE=on
35

4-
# Set the working directory inside the container
56
WORKDIR /app
67

7-
# Copy the go.mod and go.sum files to download dependencies
8-
COPY go.mod go.sum ./
8+
COPY go.mod .
9+
COPY go.sum .
910

10-
# Download dependencies
1111
RUN go mod download
1212

13-
# Copy the source code into the container
1413
COPY . .
1514

16-
# Build the Go binary
17-
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o s6-cli .
15+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o s6-cli -v ./cmd/s6cli
16+
1817

1918
# Stage 2: Create a minimal image for running the binary
2019
FROM scratch

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,12 @@ nix:
6666
# RUN COMMANDS OF CLI WITH DEFAULT ARGS
6767
# ==================================================================================== #
6868

69+
## lint: lint s6-overlay folders and files
6970
.PHONY: lint
7071
lint:
7172
@go run ./cmd/s6cli $(ARGS) lint
7273

74+
## mermaid: generate mermaid graph
7375
.PHONY: mermaid
7476
mermaid:
7577
@go run ./cmd/s6cli $(ARGS) mermaid

0 commit comments

Comments
 (0)