github.com/operator-framework/operator-lifecycle-manager@v0.30.0/.github/workflows/goreleaser.yaml (about)

     1  name: release
     2  on:
     3    pull_request:
     4    push:
     5      tags:
     6        - 'v*'
     7    workflow_dispatch:
     8  jobs:
     9    release:
    10      runs-on: ubuntu-latest
    11      steps:
    12        - name: Checkout
    13          uses: actions/checkout@v4
    14          with:
    15            fetch-depth: 0
    16        - name: Set up Go
    17          uses: actions/setup-go@v5
    18          with:
    19            go-version-file: "go.mod"
    20  
    21        - name: Get the image tag
    22          run: |
    23            # Source: https://github.community/t/how-to-get-just-the-tag-name/16241/32
    24            if [[ $GITHUB_REF == refs/tags/* ]]; then
    25              echo IMAGE_TAG="${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
    26            else
    27              echo IMAGE_TAG="snapshot" >> $GITHUB_ENV
    28            fi
    29  
    30        - name: Create a draft release
    31          uses: softprops/action-gh-release@v2
    32          id: release
    33          if: startsWith(github.ref, 'refs/tags')
    34          env:
    35            GITHUB_TOKEN: ${{ github.token }}
    36          with:
    37            name: ${{ env.IMAGE_TAG }}
    38            draft: true
    39  
    40        - name: Set up QEMU
    41          uses: docker/setup-qemu-action@v3
    42  
    43        - name: Docker Login
    44          uses: docker/login-action@v3
    45          if: startsWith(github.ref, 'refs/tags')
    46          with:
    47            registry: quay.io
    48            username: ${{ secrets.QUAY_USERNAME }}
    49            password: ${{ secrets.QUAY_PASSWORD }}
    50  
    51        - name: Run GoReleaser
    52          uses: goreleaser/goreleaser-action@v6
    53          with:
    54            version: 0.177.0
    55            args: release --rm-dist ${{ github.event_name == 'pull_request' && '--snapshot' || '' }}
    56          env:
    57            GITHUB_TOKEN: ${{ github.token }}
    58            IMAGE_REPO: quay.io/operator-framework/olm
    59            PKG: github.com/operator-framework/operator-lifecycle-manager
    60  
    61        - name: Generate quickstart release manifests
    62          if: startsWith(github.ref, 'refs/tags')
    63          run: make release RELEASE_VERSION=${{ env.IMAGE_TAG }} IMAGE_REPO=quay.io/operator-framework/olm
    64  
    65        - name: Update release artifacts with rendered Kubernetes release manifests
    66          uses: softprops/action-gh-release@v2
    67          if: startsWith(github.ref, 'refs/tags')
    68          with:
    69            name: ${{ env.IMAGE_TAG }}
    70            files: |
    71              deploy/upstream/quickstart/crds.yaml
    72              deploy/upstream/quickstart/olm.yaml
    73              deploy/upstream/quickstart/install.sh
    74            draft: true
    75            token: ${{ github.token }}