Skip to content

Commit

Permalink
bring release process more inline kubectl-opslevel
Browse files Browse the repository at this point in the history
  • Loading branch information
rocktavious committed Oct 4, 2021
1 parent 4c0b29d commit dbafd20
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 46 deletions.
15 changes: 0 additions & 15 deletions .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
{{ if .Versions -}}
<a name="unreleased"></a>
## [Unreleased]

{{ if .Unreleased.CommitGroups -}}
{{ range .Unreleased.CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
Expand Down Expand Up @@ -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 }}
Expand Down
43 changes: 16 additions & 27 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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}
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<a name="unreleased"></a>
## [Unreleased]

<a name="v0.3.1"></a>
## [v0.3.1] - 2021-10-04
### Docs
- cleanup readme to bring it more inline with kubectl-opslevel

### Feature
- set custom graphql user agent extras


<a name="v0.3.0"></a>
Expand Down Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion src/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -75,4 +83,7 @@ signs:
- "--detach-sign"
- "${artifact}"
changelog:
skip: true
sort: desc
filters:
exclude:
- "^Merge"
11 changes: 11 additions & 0 deletions src/RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

<a name="v0.3.1"></a>
## [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

0 comments on commit dbafd20

Please sign in to comment.