-
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
6 changed files
with
227 additions
and
8 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,46 @@ | ||
name: Create release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: read | ||
env: | ||
REGISTRY: ghcr.io | ||
DOCKERFILE: ${{ github.workspace }}/goreleaser.dockerfile | ||
|
||
jobs: | ||
release: | ||
permissions: | ||
contents: 'write' | ||
id-token: 'write' | ||
pull-requests: 'read' | ||
repository-projects: 'write' | ||
packages: 'write' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.GIT_CHECKOUT_KEY }} | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
VERSION=sha-${GITHUB_SHA::8} | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
VERSION=${GITHUB_REF/refs\/tags\//} | ||
fi | ||
echo ::set-output name=BUILD_DATE::$(date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
echo ::set-output name=VERSION::${VERSION} | ||
- name: Generate manifests | ||
run: | | ||
mkdir -p output | ||
kustomize build ./config/default > ./output/install.yaml | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v1 | ||
with: | ||
version: latest | ||
args: release --release-notes=docs/release_notes/${{ steps.prep.outputs.VERSION }}.md --skip-validate | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 @@ | ||
# This is an example .goreleaser.yml file with some sensible defaults. | ||
# Make sure to check the documentation at https://goreleaser.com | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- main: main.go | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
archives: | ||
- name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
release: | ||
extra_files: | ||
- glob: output/install.yaml | ||
checksum: | ||
name_template: 'checksums.txt' | ||
extra_files: | ||
- glob: output/install.yaml | ||
snapshot: | ||
name_template: "{{ incpatch .Version }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
# for more information on what this target does: https://goreleaser.com/errors/docker-build/ | ||
dockers: | ||
- id: linux-build | ||
image_templates: | ||
- "{{ .Env.REGISTRY }}/skarlso/{{ .ProjectName }}:{{ .Tag }}" | ||
- "{{ .Env.REGISTRY }}/skarlso/{{ .ProjectName }}:latest" | ||
# GOOS of the built binary that should be used. | ||
goos: linux | ||
# GOARCH of the built binary that should be used. | ||
goarch: amd64 | ||
dockerfile: "{{ .Env.DOCKERFILE }}" | ||
build_flag_templates: | ||
- "--platform=linux/amd64" |
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 |
---|---|---|
|
@@ -25,3 +25,4 @@ spec: | |
namespace: crd-bootstrap-system | ||
version: | ||
semver: 1.0.0 | ||
continueOnValidationError: true |
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 @@ | ||
FROM gcr.io/distroless/static:nonroot | ||
WORKDIR / | ||
COPY crd-bootstrap /manager | ||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["/manager"] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.