From dbafd20328849adbda9e7a84c171ddc86c18debd Mon Sep 17 00:00:00 2001 From: Kyle Rockman Date: Mon, 4 Oct 2021 09:39:39 -0500 Subject: [PATCH] bring release process more inline kubectl-opslevel --- .chglog/CHANGELOG.tpl.md | 15 ------------ .github/workflows/release.yaml | 43 +++++++++++++--------------------- CHANGELOG.md | 12 +++++++--- src/.goreleaser.yml | 13 +++++++++- src/RELEASE_NOTES | 11 +++++++++ 5 files changed, 48 insertions(+), 46 deletions(-) create mode 100644 src/RELEASE_NOTES diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md index 389e9789..391d531f 100755 --- a/.chglog/CHANGELOG.tpl.md +++ b/.chglog/CHANGELOG.tpl.md @@ -1,17 +1,3 @@ -{{ if .Versions -}} - -## [Unreleased] - -{{ if .Unreleased.CommitGroups -}} -{{ range .Unreleased.CommitGroups -}} -### {{ .Title }} -{{ range .Commits -}} -- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} -{{ end }} -{{ end -}} -{{ end -}} -{{ end -}} - {{ range .Versions }} ## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }} @@ -40,7 +26,6 @@ {{ end -}} {{- if .Versions }} -[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD {{ range .Versions -}} {{ if .Tag.Previous -}} [{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c2f91da1..87a0837a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -29,11 +29,26 @@ jobs: # These secrets will need to be configured for the repository: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + - name: Login to Public ECR + uses: docker/login-action@v1 + with: + registry: public.ecr.aws + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + env: + AWS_REGION: us-east-1 + - name: Cache Docker Layers + run: docker pull public.ecr.aws/opslevel/cli:v0.3.0 || true + # - name: Write Release Notes + # run: | + # curl -L https://github.com/git-chglog/git-chglog/releases/download/v0.15.0/git-chglog_0.15.0_linux_amd64.tar.gz | tar xz -C /usr/local/bin git-chglog + # chmod 755 /usr/local/bin/git-chglog + # /usr/local/bin/git-chglog $(git describe --tags $(git rev-list --tags --max-count=1)) > RELEASE_NOTES - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: version: latest - args: release --rm-dist + args: release --rm-dist --release-notes=RELEASE_NOTES workdir: ./src env: GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} @@ -59,29 +74,3 @@ jobs: # run: ci/deploy-rpm.sh # - name: Create deb repository # run: ci/deploy-deb.sh - release-docker: - name: Release Docker Image - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Login to Public ECR - uses: docker/login-action@v1 - with: - registry: public.ecr.aws - username: ${{ secrets.AWS_ACCESS_KEY_ID }} - password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - env: - AWS_REGION: us-east-1 - - name: Build & Push - run: | - git fetch --tags --force - TAG=$(git describe --tags --match "v[0-9].*" --always) - IMAGE="opslevel:${TAG}" - docker build -t ${IMAGE} --build-arg VERSION=$(git describe --tags --long --abbrev=12 --match "v[0-9].*" --always) . - - AWS_IMAGE="public.ecr.aws/opslevel/cli:${TAG}" - docker tag ${IMAGE} ${AWS_IMAGE} - docker push ${AWS_IMAGE} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 28c40afb..abeba5c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ - -## [Unreleased] + + +## [v0.3.1] - 2021-10-04 +### Docs +- cleanup readme to bring it more inline with kubectl-opslevel + +### Feature +- set custom graphql user agent extras @@ -104,7 +110,7 @@ - add ability to scrape git commit info if available -[Unreleased]: https://github.com/OpsLevel/cli/compare/v0.3.0...HEAD +[v0.3.1]: https://github.com/OpsLevel/cli/compare/v0.3.0...v0.3.1 [v0.3.0]: https://github.com/OpsLevel/cli/compare/v0.3.0-beta.5...v0.3.0 [v0.3.0-beta.5]: https://github.com/OpsLevel/cli/compare/v0.3.0-beta.4...v0.3.0-beta.5 [v0.3.0-beta.4]: https://github.com/OpsLevel/cli/compare/v0.3.0-beta.3...v0.3.0-beta.4 diff --git a/src/.goreleaser.yml b/src/.goreleaser.yml index 1d23d75a..f1916add 100644 --- a/src/.goreleaser.yml +++ b/src/.goreleaser.yml @@ -25,6 +25,14 @@ builds: - goos: darwin goarch: '386' binary: '{{ .ProjectName }}' +dockers: + - image_templates: + - "public.ecr.aws/opslevel/cli:{{ .Tag }}" + build_flag_templates: + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - "--label=org.opencontainers.image.version={{ .Tag }}" + - "--build-arg=VERSION={{ .Tag }}" nfpms: - formats: - deb @@ -75,4 +83,7 @@ signs: - "--detach-sign" - "${artifact}" changelog: - skip: true + sort: desc + filters: + exclude: + - "^Merge" diff --git a/src/RELEASE_NOTES b/src/RELEASE_NOTES new file mode 100644 index 00000000..f76c07b4 --- /dev/null +++ b/src/RELEASE_NOTES @@ -0,0 +1,11 @@ + + +## [v0.3.1] - 2021-10-04 +### Docs +- cleanup readme to bring it more inline with kubectl-opslevel + +### Feature +- set custom graphql user agent extras + + +[v0.3.1]: https://github.com/OpsLevel/cli/compare/v0.3.0...v0.3.1