1
0
Fork 0
mirror of https://github.com/external-secrets/external-secrets.git synced 2024-12-14 11:57:59 +00:00
external-secrets/.github/workflows/release.yml

125 lines
4 KiB
YAML
Raw Normal View History

2021-04-30 22:23:51 +00:00
name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: 'version to release, e.g. v1.5.13'
required: true
default: 'v0.1.0'
feat: LTS release process (#2155) * feat: auto-update dependencies Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * docs: add release docs Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * fix: remove note about image tag Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * fix: add variables to allow build from release branch Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * fix: github ref regex match release branch Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * feat: migrate to new issue template format Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> --------- Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com>
2023-05-15 07:06:15 +00:00
source_ref:
description: 'source ref to publish from. E.g.: main or release-x.y'
required: true
default: 'main'
2021-04-30 22:23:51 +00:00
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
2021-04-30 22:23:51 +00:00
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
2021-04-30 22:23:51 +00:00
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2021-04-30 22:23:51 +00:00
with:
fetch-depth: 0
ref: ${{ github.event.inputs.source_ref }}
2021-04-30 22:23:51 +00:00
- name: Create Release
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5
2021-04-30 22:23:51 +00:00
with:
tag_name: ${{ github.event.inputs.version }}
target_commitish: ${{ github.event.inputs.source_ref }}
generate_release_notes: true
body: |
Image: `${{ env.IMAGE_NAME }}:${{ github.event.inputs.version }}`
Image: `${{ env.IMAGE_NAME }}:${{ github.event.inputs.version }}-ubi`
Image: `${{ env.IMAGE_NAME }}:${{ github.event.inputs.version }}-ubi-boringssl`
2021-04-30 22:23:51 +00:00
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Update Docs
feat: LTS release process (#2155) * feat: auto-update dependencies Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * docs: add release docs Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * fix: remove note about image tag Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * fix: add variables to allow build from release branch Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * fix: github ref regex match release branch Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * feat: migrate to new issue template format Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> --------- Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com>
2023-05-15 07:06:15 +00:00
if: github.ref == 'refs/heads/main'
run: make docs.publish DOCS_VERSION=${{ github.event.inputs.version }} DOCS_ALIAS=latest
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
2021-04-30 22:23:51 +00:00
promote:
name: Promote Container Image
runs-on: ubuntu-latest
strategy:
matrix:
include:
- tag_suffix: "" # distroless image
- tag_suffix: "-ubi" # ubi image
- tag_suffix: "-ubi-boringssl" # ubi image
permissions:
id-token: write
contents: write
env:
feat: LTS release process (#2155) * feat: auto-update dependencies Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * docs: add release docs Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * fix: remove note about image tag Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * fix: add variables to allow build from release branch Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * fix: github ref regex match release branch Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * feat: migrate to new issue template format Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> --------- Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com>
2023-05-15 07:06:15 +00:00
SOURCE_TAG: ${{ github.event.inputs.source_ref }}${{ matrix.tag_suffix }}
RELEASE_TAG: ${{ github.event.inputs.version }}${{ matrix.tag_suffix }}
2021-04-30 22:23:51 +00:00
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2021-04-30 22:23:51 +00:00
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
id: setup-go
with:
go-version-file: "go.mod"
- name: Download Go modules
if: ${{ steps.setup-go.outputs.cache-hit != 'true' }}
run: go mod download
2021-04-30 22:23:51 +00:00
- name: Login to Docker
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
2021-04-30 22:23:51 +00:00
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Promote Container Image
run: make docker.promote
- name: Build release manifests
run: |
# temporarily patch the version so we generate manifests with the new version
yq e -i '.version = "${{ github.event.inputs.version }}"' ./deploy/charts/external-secrets/Chart.yaml
yq e -i '.appVersion = "${{ github.event.inputs.version }}"' ./deploy/charts/external-secrets/Chart.yaml
make manifests
- name: Sign promoted image
id: sign
uses: ./.github/actions/sign
with:
image-name: ${{ env.IMAGE_NAME }}
image-tag: ${{ env.RELEASE_TAG }}
GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update Release
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5
with:
tag_name: ${{ github.event.inputs.version }}
files: |
provenance.${{ env.RELEASE_TAG }}.intoto.jsonl
sbom.${{ env.RELEASE_TAG }}.spdx.json
bin/deploy/manifests/external-secrets.yaml
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"