Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
reddec committed May 5, 2023
0 parents commit 0610033
Show file tree
Hide file tree
Showing 41 changed files with 4,420 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and release
on:
push:
tags:
- 'v*'

env:
REGISTRY: ghcr.io

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '~1.20'
id: go
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
lfs: true
fetch-depth: 0
- name: Checkout LFS objects
run: git lfs checkout
- name: Pull tag
run: git fetch --tags
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*.sqlite
.idea
.vscode
.DS_Store
/dist
/.local
/*.pdf
/.goreleaser.local.yaml
18 changes: 18 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
run:
tests: false
linters:
enable-all: true
disable:
- goerr113
- contextcheck
- exhaustivestruct
- wrapcheck
- varnamelen
- exhaustruct
- lll
- wsl
- nlreturn
- gofumpt
- funlen
- gci
- nonamedreturns
58 changes: 58 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
flags:
- -trimpath
goarch:
- arm64
- amd64
main: ./cmd/token-login/main.go
binary: token-login
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
dockers:
- image_templates:
- "ghcr.io/reddec/{{ .ProjectName }}:{{ .Version }}-amd64"
use: buildx
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/amd64"
- image_templates:
- "ghcr.io/reddec/{{ .ProjectName }}:{{ .Version }}-arm64v8"
use: buildx
goarch: arm64
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/arm64/v8"
docker_manifests:
- name_template: "ghcr.io/reddec/{{ .ProjectName }}:{{ .Version }}"
image_templates:
- "ghcr.io/reddec/{{ .ProjectName }}:{{ .Version }}-amd64"
- "ghcr.io/reddec/{{ .ProjectName }}:{{ .Version }}-arm64v8"
# alias for latest
- name_template: "ghcr.io/reddec/{{ .ProjectName }}:latest"
image_templates:
- "ghcr.io/reddec/{{ .ProjectName }}:{{ .Version }}-amd64"
- "ghcr.io/reddec/{{ .ProjectName }}:{{ .Version }}-arm64v8"
# alias for major version (x)
- name_template: "ghcr.io/reddec/{{ .ProjectName }}:{{.Major}}"
image_templates:
- "ghcr.io/reddec/{{ .ProjectName }}:{{ .Version }}-amd64"
- "ghcr.io/reddec/{{ .ProjectName }}:{{ .Version }}-arm64v8"
# alias for minor version (x.y)
- name_template: "ghcr.io/reddec/{{ .ProjectName }}:{{.Major}}.{{.Minor}}"
image_templates:
- "ghcr.io/reddec/{{ .ProjectName }}:{{ .Version }}-amd64"
- "ghcr.io/reddec/{{ .ProjectName }}:{{ .Version }}-arm64v8"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM scratch
# 8080 for Admin UI, 8081 for Auth
EXPOSE 8080/tcp 8081/tcp
VOLUME /data
ENV DB_URL="sqlite:///data/token-login.sqlite?cache=shared"
ENTRYPOINT ["/token-login"]
ADD token-login /
Loading

0 comments on commit 0610033

Please sign in to comment.