Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release workflow #643

Merged
merged 14 commits into from
Mar 21, 2023
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
tags:
- "*"

permissions: write-all

jobs:
build_frontend:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -75,3 +77,28 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
PURPLIN_BOT: ${{ secrets.PURPLIN_BOT }}

- uses: actions/checkout@v3
with:
repository: tailwarden/helm
ref: master
path: helm
token: ${{ secrets.PURPLIN_BOT }}
persist-credentials: true

- name: "Create new values.yaml"
run: |
export VERSION=$(echo $TAG | cut -c2-)
cat templates/values.template.yaml | envsubst > helm/values.yaml
env:
TAG: ${{ github.ref_name }}

- name: "Push changes to tailwarden/helm"
run: |
cd ./helm
git add .
git config user.name "purplin"
git config user.email "purplin@tailwarden.com"
git commit -m "Bump version to ${VERSION}"
git push
47 changes: 40 additions & 7 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,64 @@ builds:
goarch:
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64
- goos: linux
goarch: arm64

blobs:
- provider: s3
bucket: komiser-releases
folder: "/{{.Version}}"
region: eu-central-1

brews:
- tap:
owner: tailwarden
name: homebrew-komiser
branch: master
token: "{{ .Env.PURPLIN_BOT }}"
commit_author:
name: purplin
email: purplin@tailwarden.com
folder: Formula
homepage: "https://komiser.io"
description: "Komiser.io command line interface"
url_template: "https://cli.komiser.io/{{ .Tag }}/{{ .ArtifactName }}"
url_template: "https://cli.komiser.io/{{ .Version }}/{{ .ArtifactName }}"

dockers:
- image_templates:
- tailwarden/komiser:{{ .Tag }}
- tailwarden/komiser:latest
- tailwarden/komiser:{{ .FullCommit }}
- tailwarden/komiser:{{ .Version }}-amd64
- tailwarden/komiser:{{ .FullCommit }}-amd64
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--platform linux/amd64,linux/arm64"
- "--build-arg SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY"
- --platform=linux/amd64
- --build-arg=SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY
- image_templates:
- tailwarden/komiser:{{ .Version }}-arm64
- tailwarden/komiser:{{ .FullCommit }}-arm64
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- --platform=linux/arm64
- --build-arg=SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY
- --build-arg=VERSION={{ .Version }}

docker_manifests:
- name_template: tailwarden/komiser:{{ .FullCommit }}
image_templates:
- tailwarden/komiser:{{ .FullCommit }}-amd64
- tailwarden/komiser:{{ .FullCommit }}-arm64
- name_template: tailwarden/komiser:{{ .Version }}
image_templates:
- tailwarden/komiser:{{ .Version }}-amd64
- tailwarden/komiser:{{ .Version }}-arm64
- name_template: tailwarden/komiser:latest
image_templates:
- tailwarden/komiser:{{ .Version }}-amd64
- tailwarden/komiser:{{ .Version }}-arm64

release:
github:
Expand All @@ -46,7 +79,7 @@ release:
draft: true

archives:
- format: tar.gz
- format: binary
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MAINTAINER mlabouardy <mohamed@tailwarden.com>
RUN echo "Running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log

ENV SEGMENT_WRITE_KEY $SEGMENT_WRITE_KEY
ENV VERSION 3.0.7
ENV VERSION $VERSION

RUN apk update && apk add curl
RUN curl -L https://cli.komiser.io/$VERSION/linux/komiser -o /usr/bin/komiser && \
Expand Down
7 changes: 7 additions & 0 deletions templates/values.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
image:
repository: tailwarden/komiser
tag: ${VERSION}
pullPolicy: IfNotPresent

aws:
region: "eu-central-1"