Publish Release #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "Tag" | |
required: true | |
permissions: | |
id-token: write | |
contents: write | |
pull-requests: write | |
jobs: | |
tag: | |
name: Tag + Branch | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- uses: azure/setup-kubectl@v3 | |
id: install | |
- name: Setup helmfile | |
uses: mamezou-tech/[email protected] | |
- name: Update manifests | |
env: | |
TAG: "${{ github.event.inputs.tag }}" | |
run: | | |
sudo apt-get install -y gettext | |
bash scripts/patch-image-tag.sh | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "Release ${{ github.event.inputs.tag }}" | |
tagging_message: "${{ github.event.inputs.tag }}" | |
branch: "release/${{ github.event.inputs.tag }}" | |
create_branch: true | |
images: | |
name: Build Images | |
needs: tag | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.inputs.tag }} | |
- name: Set up QEMU | |
id: qemu | |
uses: docker/setup-qemu-action@v2 | |
with: | |
image: tonistiigi/binfmt:latest | |
platforms: all | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build Images | |
env: | |
TAG: "${{ github.event.inputs.tag }}" | |
run: | | |
# Build first to ensure all images create successfully | |
scripts/build-image.sh -r 'public.ecr.aws/aws-containers' -t $TAG --multi-arch | |
- name: Get AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
role-session-name: GithubActionsSession | |
- name: Login to Amazon ECR Public | |
id: login-ecr-public | |
uses: aws-actions/amazon-ecr-login@v1 | |
with: | |
registry-type: public | |
- name: Push Images | |
env: | |
TAG: "${{ github.event.inputs.tag }}" | |
run: | | |
# Push all images | |
scripts/build-image.sh -r 'public.ecr.aws/aws-containers' -t $TAG --multi-arch -p | |
- name: Push Helm Charts | |
env: | |
TAG: "${{ github.event.inputs.tag }}" | |
run: | | |
# Push all charts | |
scripts/push-charts.sh -r 'public.ecr.aws/aws-containers' | |
release: | |
name: Release | |
needs: [tag, images] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.inputs.tag }} | |
- name: Merge to main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh pr create -B main -H release/${{ github.event.inputs.tag }} --title 'chore(release): ${{ github.event.inputs.tag }}' --body 'Generate pull request for release' | |
- name: Build Changelog | |
id: github_release | |
uses: mikepenz/release-changelog-builder-action@v3 | |
with: | |
configuration: "release-notes-configuration.json" | |
toTag: ${{ github.event.inputs.tag }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ github.event.inputs.tag }} | |
name: Release ${{ github.event.inputs.tag }} | |
body: ${{steps.github_release.outputs.changelog}} |