Skip to content

chore: bump duty to v1.0.1340 (#2976) #1558

chore: bump duty to v1.0.1340 (#2976)

chore: bump duty to v1.0.1340 (#2976) #1558

Workflow file for this run

name: Create Release
on:
push:
branches:
- master
workflow_dispatch:
inputs:
channel:
description: "Release channel"
required: true
default: "rc"
type: choice
options:
- stable
- rc
permissions:
contents: read
jobs:
semantic-release:
permissions:
contents: write
issues: write
pull-requests: write
uses: flanksource/action-workflows/.github/workflows/create-release.yml@a7df3dcb783c34338e46318364e99c0ada62bcd9
binary-linux:
runs-on: ubuntu-latest
needs: semantic-release
if: needs.semantic-release.outputs.published == 'true'
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: v1.26.x
- run: make linux compress
env:
VERSION: ${{ needs.semantic-release.outputs.tag }}
- name: Upload binaries to draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ needs.semantic-release.outputs.tag }}
run: |
gh release upload "$TAG" ./.release/* \
--repo "$GITHUB_REPOSITORY" \
--clobber
binary-darwin:
runs-on: ubuntu-latest
needs: semantic-release
if: needs.semantic-release.outputs.published == 'true'
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: v1.26.x
- run: make darwin compress
env:
VERSION: ${{ needs.semantic-release.outputs.tag }}
- name: Upload binaries to draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ needs.semantic-release.outputs.tag }}
run: |
gh release upload "$TAG" ./.release/* \
--repo "$GITHUB_REPOSITORY" \
--clobber
binary-windows:
runs-on: ubuntu-latest
needs: semantic-release
if: needs.semantic-release.outputs.published == 'true'
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: v1.26.x
- run: make windows compress
env:
VERSION: ${{ needs.semantic-release.outputs.tag }}
- name: Upload binaries to draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ needs.semantic-release.outputs.tag }}
run: |
gh release upload "$TAG" ./.release/* \
--repo "$GITHUB_REPOSITORY" \
--clobber
docker:
needs: semantic-release
if: needs.semantic-release.outputs.published == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Clear up disk space
run: |
rm -rf /usr/share/dotnet
rm -rf /opt/ghc
rm -rf /usr/local/share/boost
rm -rf $AGENT_TOOLSDIRECTORY
rm -rf /opt/hostedtoolcache
- name: Set version
# Always use git tags as semantic release can fail due to rate limit
run: |
git fetch --prune --unshallow
echo "RELEASE_VERSION=$(git describe --abbrev=0 --tags | sed -e 's/^v//')" >> $GITHUB_ENV
- name: Set up Docker Buildx #must be executed before a step that contains platforms
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Log in to Docker Hub
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6.1.0
with:
aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@376925c9d111252e87ae59691e5a442dd100ef6a # v2.1.3
with:
registry-type: public
- name: Publish Minimal Image to Dockerhub & ECR Public
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
env:
REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
REGISTRY_ALIAS: k4y9r6y5
REPOSITORY: canary-checker
IMAGE_TAG: "v${{ env.RELEASE_VERSION }}"
with:
context: .
file: build/minimal/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY }}/${{ env.REGISTRY_ALIAS }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
docker.io/flanksource/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
docker.io/flanksource/${{ env.REPOSITORY }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
docker-full:
needs: semantic-release
if: needs.semantic-release.outputs.published == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Clear up disk space
run: |
rm -rf /usr/share/dotnet
rm -rf /opt/ghc
rm -rf /usr/local/share/boost
rm -rf $AGENT_TOOLSDIRECTORY
rm -rf /opt/hostedtoolcache
- name: Set version
# Always use git tags as semantic release can fail due to rate limit
run: |
git fetch --prune --unshallow
echo "RELEASE_VERSION=$(git describe --abbrev=0 --tags | sed -e 's/^v//')" >> $GITHUB_ENV
- name: Set up Docker Buildx #must be executed before a step that contains platforms
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Log in to Docker Hub
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6.1.0
with:
aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@376925c9d111252e87ae59691e5a442dd100ef6a # v2.1.3
with:
registry-type: public
- name: Publish image to Dockerhub & ECR Public
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
env:
REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
REGISTRY_ALIAS: k4y9r6y5
REPOSITORY: canary-checker
IMAGE_TAG: "v${{ env.RELEASE_VERSION }}"
with:
context: .
file: build/full/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY }}/${{ env.REGISTRY_ALIAS }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}-full
docker.io/flanksource/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}-full
docker.io/flanksource/${{ env.REPOSITORY }}:latest-full
cache-from: type=gha
cache-to: type=gha,mode=max
docker-slim:
needs: semantic-release
if: needs.semantic-release.outputs.published == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Clear up disk space
run: |
rm -rf /usr/share/dotnet
rm -rf /opt/ghc
rm -rf /usr/local/share/boost
rm -rf $AGENT_TOOLSDIRECTORY
rm -rf /opt/hostedtoolcache
- name: Set version
# Always use git tags as semantic release can fail due to rate limit
run: |
git fetch --prune --unshallow
echo "RELEASE_VERSION=$(git describe --abbrev=0 --tags | sed -e 's/^v//')" >> $GITHUB_ENV
- name: Set up Docker Buildx #must be executed before a step that contains platforms
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Log in to Docker Hub
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6.1.0
with:
aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@376925c9d111252e87ae59691e5a442dd100ef6a # v2.1.3
with:
registry-type: public
- name: Publish Image to Dockerhub & ECR Public
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
env:
REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
REGISTRY_ALIAS: k4y9r6y5
REPOSITORY: canary-checker
IMAGE_TAG: "v${{ env.RELEASE_VERSION }}"
with:
context: .
file: build/slim/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY }}/${{ env.REGISTRY_ALIAS }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}-slim
docker.io/flanksource/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}-slim
docker.io/flanksource/${{ env.REPOSITORY }}:latest-slim
cache-from: type=gha
cache-to: type=gha,mode=max
helm:
runs-on: ubuntu-latest
needs: [semantic-release, docker, docker-slim, docker-full]
if: always() && needs.semantic-release.outputs.published == 'true'
outputs:
release-version: ${{ steps.version.outputs.release-version }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install yq
uses: mikefarah/yq@751d8ad57b84f1794661bc70c0afb92a22ad7b3c # v4.53.2
- name: Set version
id: version
# Always use git tags as semantic release can fail due to rate limit
run: |
git fetch --prune --unshallow
VERSION=$(git describe --abbrev=0 --tags | sed -e 's/^v//')
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
echo "release-version=$VERSION" >> $GITHUB_OUTPUT
- name: Update chart version
run: yq -i e '.version = "${{ env.RELEASE_VERSION }}"' chart/Chart.yaml
- name: Update app version
run: yq -i e '.appVersion = "${{ env.RELEASE_VERSION }}"' chart/Chart.yaml
- name: Update image tags
run: yq -i e '.image.tag = "v${{ env.RELEASE_VERSION }}"' chart/values.yaml
- name: Set up Helm
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
with:
version: v3.20.0
- name: Package Helm chart
run: |
make chart
- name: Upload helm chart artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: helm-chart
path: canary-checker-*.tgz
push-helm-chart:
needs: [semantic-release, helm]
if: always() && needs.semantic-release.outputs.published == 'true' && needs.helm.result == 'success'
uses: flanksource/action-workflows/.github/workflows/push-helm-chart.yml@e5cf4306853b95b7e815392359b6105169ecc37a # main
with:
filename_regex: "canary-checker-*.tgz"
version: ${{ needs.helm.outputs.release-version }}
pr_title: "Release ${{ needs.helm.outputs.release-version }} of ${{ github.repository }}"
secrets:
token: ${{ secrets.FLANKBOT }}
publish-release:
needs: [semantic-release, binary-linux, binary-darwin, binary-windows, docker, docker-slim, docker-full, helm, push-helm-chart]
if: >-
always() &&
needs.semantic-release.outputs.published == 'true' &&
(
needs.binary-linux.result == 'success' ||
needs.binary-darwin.result == 'success' ||
needs.binary-windows.result == 'success' ||
needs.docker.result == 'success' ||
needs.docker-slim.result == 'success' ||
needs.docker-full.result == 'success'
)
permissions:
contents: write
uses: flanksource/action-workflows/.github/workflows/publish-release.yml@e22094854bc7759abafb4ee49cb5585a5ccf91b0 # main
with:
tag: ${{ needs.semantic-release.outputs.tag }}