Skip to content

Commit

Permalink
ci: only publish v releases
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed May 11, 2021
1 parent 3dd3708 commit 7251471
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7251471

Please sign in to comment.