diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ee2d379..74bf6646 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,32 +89,17 @@ jobs: publish-release: runs-on: ubuntu-latest needs: [ publish-images ] - if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/v') steps: - - name: Checkout - uses: actions/checkout@v2 - with: - # 0 indicates all history for all branches and tags. - fetch-depth: 0 - # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions + - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: go-version: 1.16 - - name: Get tag - run: | - tag=$(basename $GITHUB_REF) - if [ $tag = "main" ]; then - tag="latest" - fi - echo "##[set-output name=tag;]$tag" - id: tag - - name: Generate release artifacts - run: make manifests changelog TAG=${{ github.tag.outputs.tag }} - - name: Draft release + - run: make manifests changelog TAG=${GITHUB_REF##*/} + - name: Publish release uses: softprops/action-gh-release@v1 with: - tag_name: ${{ steps.tag.outputs.tag }} - prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }} + prerelease: ${{ startsWith(github.ref, 'refs/tags/v0') || contains(github.ref, 'rc') }} body_path: changelog files: | config/*.yaml