-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
98 changed files
with
12,758 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Build | ||
|
||
on: | ||
push: {} | ||
|
||
jobs: | ||
build: | ||
name: 📦 Build & Test | ||
runs-on: ubuntu-latest | ||
outputs: | ||
image: ${{ steps.meta.outputs.tags }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: docker/setup-buildx-action@v2 | ||
- uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
tags: | | ||
type=ref,event=branch,pattern=snapshot-{{sha}} | ||
labels: | | ||
org.opencontainers.image.source=git@github.com:${{ github.repository }}.git | ||
org.opencontainers.image.version=${{ github.head_ref || github.ref_name }} | ||
org.opencontainers.image.revision=${{ github.sha }} | ||
de.interhyp.image.servicename=metadata-service | ||
- id: build-push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
release: | ||
name: 🚀 Release | ||
if: github.ref == 'refs/heads/main' | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- id: semantic-release | ||
uses: go-semantic-release/action@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
prerelease: false | ||
allow-initial-development-versions: true # remove to trigger an initial 1.0.0 release | ||
changelog-generator-opt: "emojis=true" | ||
hooks: goreleaser | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- id: repository-id | ||
uses: ASzc/change-string-case-action@v6 | ||
with: | ||
string: ${{ github.repository }} | ||
- if: steps.semantic-release.outputs.version != '' | ||
run: | | ||
TARGET=ghcr.io/${{ steps.repository-id.outputs.lowercase }}:${{ steps.semantic-release.outputs.version }} | ||
SOURCE=${{ needs.build.outputs.image }} | ||
docker pull $SOURCE | ||
docker tag $SOURCE $TARGET | ||
docker push $TARGET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# If you prefer the allow list template instead of the deny list, see community template: | ||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore | ||
# | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
*jar | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
|
||
# Go workspace file | ||
go.work | ||
|
||
# IntelliJ project files | ||
*.iml | ||
*.iws | ||
*.ipr | ||
.idea/ | ||
|
||
# Eclipse project file | ||
.settings/ | ||
.classpath | ||
.project | ||
|
||
# NetBeans specific | ||
nbproject/private/ | ||
build/ | ||
nbbuild/ | ||
dist/ | ||
nbdist/ | ||
nbactions.xml | ||
nb-configuration.xml | ||
|
||
# OS | ||
.DS_Store | ||
|
||
# Project specific | ||
local-config.yaml | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
preset: angular | ||
plugins: | ||
- "@semantic-release/commit-analyzer" | ||
- "@semantic-release/release-notes-generator" | ||
- "@semantic-release/changelog" | ||
- "@semantic-release/git" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ARG GOLANG_VERSION=1 | ||
|
||
FROM golang:${GOLANG_VERSION} AS build | ||
|
||
COPY . /app | ||
WORKDIR /app | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" main.go \ | ||
&& go test -v ./... -coverpkg=./internal/... \ | ||
&& go vet ./... | ||
|
||
FROM scratch | ||
|
||
COPY --from=build /app/main /main | ||
COPY --from=build /etc/ssl/certs /etc/ssl/certs | ||
COPY --from=build /app/api/openapi.yaml /api/openapi.yaml | ||
|
||
ENTRYPOINT ["/main"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
# under-construction | ||
# ToDos | ||
|
||
1. Improve API spec | ||
2. Implement missing endpoints | ||
3. Tests | ||
4. Improve error handling | ||
5. Support OCI | ||
6. Support configurable filesystems (memory + disk) |
Oops, something went wrong.