Skip to content

Commit 563bbdc

Browse files
committed
feat: first working release
1 parent 6bd166f commit 563bbdc

Some content is hidden

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

43 files changed

+3079
-472
lines changed

.github/workflows/build.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
paths:
8+
- "Dockerfile"
9+
- "go.mod"
10+
- "go.sum"
11+
- "**/*.go"
12+
- "!cmd/folder-precreator/**"
13+
- ".github/workflows/build.yml"
14+
tags:
15+
- "*"
16+
pull_request:
17+
paths:
18+
- "Dockerfile"
19+
- "go.mod"
20+
- "go.sum"
21+
- "**/*.go"
22+
- "!cmd/folder-precreator/**"
23+
- ".github/workflows/build.yml"
24+
25+
env:
26+
REGISTRY: europe-west4-docker.pkg.dev/artifact-registry-5n/dapla-lab-docker/dapla
27+
IMAGE: labid
28+
TAG: ${{ github.ref_name }}-${{ github.sha }}
29+
30+
jobs:
31+
docker:
32+
permissions:
33+
contents: "read"
34+
id-token: "write"
35+
runs-on: ubuntu-latest
36+
env:
37+
PLATFORMS: linux/amd64
38+
steps:
39+
- uses: actions/checkout@v3
40+
- id: "auth"
41+
name: "Authenticate to Google Cloud"
42+
uses: "google-github-actions/auth@v1.1.1"
43+
with:
44+
workload_identity_provider: "projects/848539402404/locations/global/workloadIdentityPools/gh-actions/providers/gh-actions"
45+
service_account: "gh-actions-dapla-lab@artifact-registry-5n.iam.gserviceaccount.com"
46+
token_format: "access_token"
47+
- name: Set up QEMU
48+
uses: docker/setup-qemu-action@v2
49+
- name: Set up Docker Buildx
50+
id: buildx
51+
uses: docker/setup-buildx-action@v2
52+
- name: Login to registry
53+
uses: docker/login-action@v2
54+
with:
55+
registry: ${{ env.REGISTRY }}
56+
username: "oauth2accesstoken"
57+
password: "${{ steps.auth.outputs.access_token }}"
58+
- name: Docker meta
59+
id: metadata
60+
uses: docker/metadata-action@v4
61+
with:
62+
images: ${{ env.REGISTRY }}/${{ env.IMAGE }}
63+
# Docker tags based on the following events/attributes
64+
tags: |
65+
type=schedule
66+
type=ref,event=branch
67+
type=ref,event=pr
68+
type=semver,pattern=v{{version}}
69+
type=semver,pattern=v{{major}}.{{minor}}
70+
type=semver,pattern=v{{major}}
71+
type=sha
72+
type=raw,value=${{ env.TAG }}, enable=true
73+
- name: Build and push
74+
uses: docker/build-push-action@v4
75+
with:
76+
context: .
77+
platforms: ${{ env.PLATFORMS }}
78+
file: Dockerfile
79+
push: ${{ github.event_name != 'pull_request' }}
80+
tags: |
81+
${{ steps.metadata.outputs.tags }}
82+
labels: ${{ steps.metadata.outputs.labels }}
83+
- name: Image digest
84+
run: echo ${{ steps.docker_build.outputs.digest }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: pre-commit
2+
3+
on: push
4+
5+
jobs:
6+
pre-commit:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: actions/setup-python@v3
11+
- uses: pre-commit/action@v3.0.0
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
name: release-please
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/create-github-app-token@v1
17+
id: app-token
18+
with:
19+
app-id: ${{ secrets.DAPLA_BOT_APP_ID }}
20+
private-key: ${{ secrets.DAPLA_BOT_PRIVATE_KEY }}
21+
22+
- uses: googleapis/release-please-action@v4
23+
with:
24+
config-file: release-please-config.json
25+
manifest-file: .release-please-manifest.json
26+
token: ${{ steps.app-token.outputs.token }}

.gitignore

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1-
# If you prefer the allow list template instead of the deny list, see community template:
2-
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3-
#
1+
42
# Binaries for programs and plugins
53
*.exe
64
*.exe~
75
*.dll
86
*.so
97
*.dylib
8+
bin/*
9+
Dockerfile.cross
1010

1111
# Test binary, built with `go test -c`
1212
*.test
1313

1414
# Output of the go coverage tool, specifically when used with LiteIDE
1515
*.out
1616

17-
# Dependency directories (remove the comment below to include it)
18-
# vendor/
19-
2017
# Go workspace file
2118
go.work
22-
go.work.sum
2319

24-
# env file
25-
.env
20+
# Kubernetes Generated files - skip generated files, except for vendored files
21+
!vendor/**/zz_generated.*
22+
23+
# editor and IDE paraphernalia
24+
.idea
25+
.vscode
26+
*.swp
27+
*.swo
28+
*~

.golangci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
run:
2+
deadline: 5m
3+
allow-parallel-runners: true
4+
5+
issues:
6+
# don't skip warning about doc comments
7+
# don't exclude the default set of lint
8+
exclude-use-default: false
9+
# restore some of the defaults
10+
# (fill in the rest as needed)
11+
exclude-rules:
12+
- path: "api/*"
13+
linters:
14+
- lll
15+
- path: "internal/*"
16+
linters:
17+
- dupl
18+
- lll
19+
linters:
20+
disable-all: true
21+
enable:
22+
- dupl
23+
- errcheck
24+
- goconst
25+
- gocyclo
26+
- gofmt
27+
- goimports
28+
- gosimple
29+
- govet
30+
- ineffassign
31+
- lll
32+
- misspell
33+
- nakedret
34+
- prealloc
35+
- staticcheck
36+
- typecheck
37+
- unconvert
38+
- unparam
39+
- unused

.ogen.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# sets generator options.
2+
generator:
3+
# sets generator features.
4+
features:
5+
enable:
6+
# Enables paths client generation
7+
# - "paths/client"
8+
# Enables paths server generation
9+
- "paths/server"
10+
# Enables validation of client requests
11+
# - "client/request/validation"
12+
# Enables validation of server responses
13+
- "server/response/validation"
14+
# Enables OpenTelemetry integration
15+
- "ogen/otel"
16+
disable_all: true

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repos:
2+
- repo: https://github.com/qoomon/git-conventional-commits
3+
rev: 2e07c12
4+
hooks:
5+
- id: conventional-commits

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.0"
3+
}

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ COPY go.sum go.sum
1212
RUN go mod download
1313

1414
# Copy the go source
15-
COPY main.go main.go
15+
COPY api/ api/
16+
COPY cmd/ cmd/
17+
COPY internal/ internal/
1618

1719
# Build
1820
# the GOARCH has not a default value to allow the binary be built according to the host where the command

0 commit comments

Comments
 (0)