Skip to content

Commit

Permalink
Merge pull request #643 from tailwarden/fix/release
Browse files Browse the repository at this point in the history
Fix release workflow
  • Loading branch information
eneskaya authored Mar 21, 2023
2 parents ae50031 + be051e4 commit 6630990
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 9 deletions.
31 changes: 31 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,32 @@ 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"
id: release-version
run: |
export VERSION=$(echo $TAG | cut -c2-)
echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_OUTPUT
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 "chore: bump version to ${VERSION}"
git push
env:
VERSION: ${{ steps.release-version.outputs.RELEASE_VERSION }}
49 changes: 42 additions & 7 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,66 @@ 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 }}"
commit_msg_template: "chore: bump version to {{ .Version }}"

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
- --build-arg=VERSION={{ .Version }}
- 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 +81,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
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ FROM --platform=$BUILDPLATFORM alpine:3.16
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG SEGMENT_WRITE_KEY
ARG VERSION
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 && \
RUN curl -L https://cli.komiser.io/$VERSION/komiser_Linux_x86_64 -o /usr/bin/komiser && \
chmod +x /usr/bin/komiser && \
mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2

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"

0 comments on commit 6630990

Please sign in to comment.