Merge pull request #1 from AthenZ/first #1
Workflow file for this run
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: release | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
VERSION: ${{ github.ref_name }} | |
REGISTRY_URL: docker.io | |
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} | |
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} | |
jobs: | |
build_images: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read # needed for checkout | |
packages: write # needed for push images | |
id-token: write # needed for keyless signing | |
steps: | |
- uses: actions/checkout@v4 | |
- id: go-version | |
run: | | |
make print-go-version >> "$GITHUB_OUTPUT" | |
- uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY_URL }} | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ steps.go-version.outputs.result }} | |
- id: release | |
run: make release | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.release.outputs.RELEASE_HELM_CHART_NAME }}-${{ steps.release.outputs.RELEASE_HELM_CHART_VERSION }}.tgz | |
path: ${{ steps.release.outputs.RELEASE_HELM_CHART_TAR }} | |
if-no-files-found: error | |
outputs: | |
RELEASE_OCI_MANAGER_IMAGE: ${{ steps.release.outputs.RELEASE_OCI_MANAGER_IMAGE }} | |
RELEASE_OCI_MANAGER_TAG: ${{ steps.release.outputs.RELEASE_OCI_MANAGER_TAG }} | |
RELEASE_HELM_CHART_NAME: ${{ steps.release.outputs.RELEASE_HELM_CHART_NAME }} | |
RELEASE_HELM_CHART_VERSION: ${{ steps.release.outputs.RELEASE_HELM_CHART_VERSION }} | |
github_release: | |
runs-on: ubuntu-latest | |
needs: build_images | |
permissions: | |
contents: write # needed for creating a PR | |
pull-requests: write # needed for creating a PR | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name "athenz-bot" | |
git config user.email "athenz-bot@users.noreply.github.com" | |
- run: | | |
touch .notes-file | |
echo "OCI_MANAGER_IMAGE: ${{ needs.build_images.outputs.RELEASE_OCI_MANAGER_IMAGE }}" >> .notes-file | |
echo "OCI_MANAGER_TAG: ${{ needs.build_images.outputs.RELEASE_OCI_MANAGER_TAG }}" >> .notes-file | |
echo "HELM_CHART_NAME: ${{ needs.build_images.outputs.RELEASE_HELM_CHART_NAME }}" >> .notes-file | |
echo "HELM_CHART_VERSION: ${{ needs.build_images.outputs.RELEASE_HELM_CHART_VERSION }}" >> .notes-file | |
- id: chart_download | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ needs.build_images.outputs.RELEASE_HELM_CHART_NAME }}-${{ needs.build_images.outputs.RELEASE_HELM_CHART_VERSION }}.tgz | |
- env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release create "$VERSION" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--title="${VERSION}" \ | |
--draft \ | |
--verify-tag \ | |
--notes-file .notes-file | |
gh release upload "$VERSION" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
"${{ steps.chart_download.outputs.download-path }}/${{ needs.build_images.outputs.RELEASE_HELM_CHART_NAME }}-${{ needs.build_images.outputs.RELEASE_HELM_CHART_VERSION }}.tgz" | |
- name: Run chart-releaser | |
uses: helm/chart-releaser-action@v1.5.0 | |
with: | |
skip_packaging: true | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
CR_PACKAGE_PATH: ${{ steps.chart_download.outputs.download-path }} | |
CR_SKIP_EXISTING: true |