Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the auto-release via tag depend on a successful build #181

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Docker build and push

on:
push:
branches:
- '*'
tags:
- 'v*'
on: [push]

env:
# TEST_TARGET: Name of the testing target in the Dockerfile
Expand All @@ -14,9 +9,6 @@ env:
# DO_TEST - true to build and run unit tests, false to skip the tests
DO_TEST: true

# DO_PUSH - true to push to the HPE_DEPLOY_REPO, false to not push
DO_PUSH: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -98,3 +90,23 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}

create_release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
- name: Repair tag
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }}
- name: Verify that the tag is annotated
run: if test x$(git for-each-ref ${{ github.ref }} | awk '{print $2}') = xtag; then /bin/true; else echo "\"${{ github.ref }}\" does not look like an annotated tag!"; /bin/false; fi
- name: Release
uses: softprops/action-gh-release@v1
with:
#prerelease: true
generate_release_notes: true

28 changes: 0 additions & 28 deletions .github/workflows/verify_tag.yml

This file was deleted.

Loading