From c9f8e7859bc6644d2851d848047adc7e5f0c4d04 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 31 Aug 2023 21:50:59 +0200 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 4 +++- .github/workflows/release.yml | 32 ++++++++++++++++++++++++++++++++ Makefile | 2 +- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b385522..d3fdacc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,13 @@ # This workflow will build a golang project # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go -name: Docker Image +name: Latest Build on: push: branches: [ "main" ] + tags: + - v* pull_request: branches: [ "main" ] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e162b6a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +# This workflow will release +name: Release + +on: + workflow_run: + workflows: [ "Latest Build" ] + branches: [ main ] + types: + - completed + +jobs: + + release: + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + steps: + - uses: actions/checkout@v3 + + - name: Release + uses: brpaz/action-semantic-release@v1 + with: + dry_run: "false" + install_plugins: "semantic-release-docker semantic-release-gcr" + branch: main + + + + + + + + diff --git a/Makefile b/Makefile index c8484a1..57aaa26 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ build_image_tag: .create_git_tag release_ghcr: export NEXT_VERSION=$(GHCR_NEXT_VERSION) && \ $(MAKE) .create_git_tag && \ - git push + git push origin $(GHCR_NEXT_VERSION) # LIB TARGETS ##############