Added release note generation to GH Actions #9
Workflow file for this run
This file contains hidden or 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: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| TAG: ${{ github.ref_name }} | |
| ORG: ${{ github.repository_owner }} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: setupGo | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '=1.22.3' | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Docker login | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| needs: [build] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: setupGo | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '=1.22.3' | |
| - name: Update manifests | |
| run: | | |
| make release RELEASE_TAG=${{ env.TAG }} ORG=${{ env.ORG }} | |
| # to be replaced with gh cli. see https://github.com/rancher-sandbox/cluster-api-provider-harvester/issues/104 | |
| # - name: Release | |
| # uses: softprops/action-gh-release@v2 | |
| # with: | |
| # prerelease: false | |
| # draft: true | |
| # fail_on_unmatched_files: true | |
| # generate_release_notes: true | |
| # discussion_category_name: Announcements | |
| # name: ${{ env.TAG }} | |
| # files: | | |
| # out/metadata.yaml | |
| # out/infrastructure-components.yaml | |
| - name: Create GitHub Release | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| if gh release view ${{ github.ref_name }} > /dev/null; then | |
| echo ${{ github.ref_name }} release exists | |
| else | |
| gh release create ${{ github.ref_name }} --draft --generate-notes | |
| fi | |
| gh release upload ${{ github.ref_name }} out/metadata.yaml | |
| gh release upload ${{ github.ref_name }} out/infrastructure-components.yaml |