Compare commits
11 Commits
1ab6f13547
...
v0.0.9
| Author | SHA1 | Date | |
|---|---|---|---|
|
1e32de279e
|
|||
|
b5c8ec45aa
|
|||
|
6e51b420d4
|
|||
|
f9732d9c33
|
|||
|
cfeced8bd9
|
|||
|
9539c193c6
|
|||
|
450b4caa95
|
|||
|
a3c392f3b3
|
|||
|
228b3423e7
|
|||
|
01f8bf706f
|
|||
|
1fffa0172d
|
58
.gitea/workflows/release.yml
Normal file
58
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,58 @@
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
version: 'v2.13.2'
|
||||
distribution: goreleaser
|
||||
args: release --clean
|
||||
env:
|
||||
GITEA_TOKEN: '${{ secrets.RELEASE_TOKEN }}'
|
||||
|
||||
docker-image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Yandex Cloud Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: cr.yandex
|
||||
username: oauth
|
||||
password: ${{ secrets.YANDEX_CLOUD_OAUTH_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
file: ./Dockerfile
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
cr.yandex/${{ secrets.YANDEX_CLOUD_REGISTRY_ID }}/trackers:${{ github.ref_name }}
|
||||
cr.yandex/${{ secrets.YANDEX_CLOUD_REGISTRY_ID }}/trackers:latest
|
||||
platforms: linux/amd64
|
||||
37
.goreleaser.yaml
Normal file
37
.goreleaser.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
version: 2
|
||||
|
||||
project_name: trackers
|
||||
|
||||
builds:
|
||||
- id: trackers
|
||||
main: ./main.go
|
||||
binary: trackers
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
|
||||
archives:
|
||||
- id: trackers
|
||||
formats:
|
||||
- tar.gz
|
||||
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||
files:
|
||||
- README.md
|
||||
|
||||
checksum:
|
||||
name_template: checksums.txt
|
||||
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- "^docs:"
|
||||
- "^test:"
|
||||
|
||||
gitea_urls:
|
||||
api: https://git.vakhrushev.me/api/v1
|
||||
download: https://git.vakhrushev.me
|
||||
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
FROM golang:1.25.5-alpine AS build
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
COPY go.mod .
|
||||
COPY go.sum .
|
||||
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /out/trackers ./main.go
|
||||
|
||||
|
||||
FROM gcr.io/distroless/static:nonroot
|
||||
|
||||
COPY --from=build /out/trackers /trackers
|
||||
|
||||
USER nonroot:nonroot
|
||||
|
||||
ENTRYPOINT ["/trackers"]
|
||||
Reference in New Issue
Block a user