diff --git a/.github/workflows/push_main.yaml b/.github/workflows/ci.yaml similarity index 63% rename from .github/workflows/push_main.yaml rename to .github/workflows/ci.yaml index 1b975272..0bafef71 100644 --- a/.github/workflows/push_main.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: Push (main) +name: CI # When pushing to the "main" branch, we: # * build the rock image @@ -8,10 +8,16 @@ name: Push (main) on: push: branches: - - main + - "main" + - "release-**" + tags: + - "v**" paths: - "rockcraft.yaml" - ".github/workflows/**.yaml" + pull_request: + branches: + - "*" workflow_dispatch: jobs: @@ -19,9 +25,11 @@ jobs: uses: ./.github/workflows/build.yaml publish: + if: ${{ (github.ref == 'refs/heads/main') || (github.ref_type == 'tag') }} needs: build uses: ./.github/workflows/publish.yaml scan: + if: ${{ (github.ref == 'refs/heads/main') || (github.ref_type == 'tag') }} needs: publish uses: ./.github/workflows/scan.yaml diff --git a/.github/workflows/push_any.yaml b/.github/workflows/push_any.yaml deleted file mode 100644 index 6e803746..00000000 --- a/.github/workflows/push_any.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: Push (any) - -# When pushing to any branch other than "main", we: -# * build the rock image - -on: - push: - branches-ignore: - - "main" - paths: - - "rockcraft.yaml" - - ".github/workflows/**.yaml" - -jobs: - build: - uses: ./.github/workflows/build.yaml diff --git a/README.md b/README.md index 77068628..20f9a495 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![Latest Version](https://img.shields.io/badge/dynamic/yaml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcanonical%2Fkratos-rock%2Fmain%2Frockcraft.yaml&query=%24.version&label=Release&color=red) [![License](https://img.shields.io/github/license/canonical/kratos-rock?label=License)](https://github.com/canonical/kratos-rock/blob/main/LICENSE) -[![Build](https://img.shields.io/github/actions/workflow/status/canonical/kratos-rock/push_main.yaml?label=Build)](https://github.com/canonical/kratos-rock/actions/workflows/push_main.yaml) +[![Release](https://github.com/canonical/kratos-rock/actions/workflows/ci.yaml/badge.svg)](https://github.com/canonical/kratos-rock/actions/workflows/ci.yaml) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196.svg)](https://conventionalcommits.org)