ci: add docker build to release
This commit is contained in:
parent
d713c25fa5
commit
e1a4e9c579
4 changed files with 33 additions and 4 deletions
14
.github/workflows/release.yaml
vendored
14
.github/workflows/release.yaml
vendored
|
|
@ -25,11 +25,23 @@ jobs:
|
|||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||
- name: Set up QEMU
|
||||
uses: https://github.com/docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: https://github.com/docker/setup-buildx-action@v3
|
||||
|
||||
- name: Install GoReleaser
|
||||
uses: https://github.com/goreleaser/goreleaser-action@v5
|
||||
uses: https://github.com/goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
install-only: true
|
||||
|
||||
- name: Docker login
|
||||
run: |
|
||||
REGISTRY="${GITHUB_SERVER_URL#https://}"
|
||||
echo "${{ secrets.PACKAGES_TOKEN }}" | docker login "$REGISTRY" -u "${{ github.repository_owner }}" --password-stdin
|
||||
echo "DOCKER_REGISTRY=$REGISTRY" >> "$GITHUB_ENV"
|
||||
echo "DOCKER_ORG=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Run GoReleaser
|
||||
run: |
|
||||
unset GITHUB_TOKEN
|
||||
|
|
|
|||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -13,5 +13,9 @@ coverage.html
|
|||
*.swp
|
||||
*.swo
|
||||
|
||||
dist/
|
||||
|
||||
.claude/
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
version: 1
|
||||
version: 2
|
||||
|
||||
project_name: resource-collector
|
||||
|
||||
|
|
@ -26,14 +26,23 @@ builds:
|
|||
|
||||
archives:
|
||||
- id: default
|
||||
format: tar.gz
|
||||
formats:
|
||||
- tar.gz
|
||||
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||
|
||||
checksum:
|
||||
name_template: checksums.txt
|
||||
|
||||
snapshot:
|
||||
name_template: "{{ incpatch .Version }}-next"
|
||||
version_template: "{{ incpatch .Version }}-next"
|
||||
|
||||
dockers_v2:
|
||||
- images:
|
||||
- "{{ .Env.DOCKER_REGISTRY }}/{{ .Env.DOCKER_ORG }}/resource-collector"
|
||||
tags:
|
||||
- "{{ .Version }}"
|
||||
- latest
|
||||
dockerfile: Dockerfile.goreleaser
|
||||
|
||||
changelog:
|
||||
sort: asc
|
||||
|
|
|
|||
4
Dockerfile.goreleaser
Normal file
4
Dockerfile.goreleaser
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
FROM gcr.io/distroless/static:nonroot
|
||||
ARG TARGETPLATFORM
|
||||
COPY ${TARGETPLATFORM}/resource-collector /resource-collector
|
||||
ENTRYPOINT ["/resource-collector"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue