From 696dbfc4d2c3b4336349aefd39e199a359a8edb2 Mon Sep 17 00:00:00 2001 From: Luca Bello Date: Wed, 11 Oct 2023 14:00:34 +0200 Subject: [PATCH] upkeep: use refactored ci --- .github/workflows/issues.yaml | 11 ++++++ .github/workflows/issues.yml | 53 ----------------------------- .github/workflows/promote.yaml | 2 +- .github/workflows/pull-request.yaml | 3 +- .github/workflows/release-edge.yaml | 11 ------ .github/workflows/release-libs.yaml | 11 ------ .github/workflows/release.yaml | 11 ++++++ .github/workflows/update-libs.yaml | 2 +- 8 files changed, 25 insertions(+), 79 deletions(-) create mode 100644 .github/workflows/issues.yaml delete mode 100644 .github/workflows/issues.yml delete mode 100644 .github/workflows/release-edge.yaml delete mode 100644 .github/workflows/release-libs.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/issues.yaml b/.github/workflows/issues.yaml new file mode 100644 index 00000000..b2eaad97 --- /dev/null +++ b/.github/workflows/issues.yaml @@ -0,0 +1,11 @@ +name: Issues + +on: [issues] + +jobs: + update: + name: Update Issue + uses: canonical/observability/.github/workflows/issues.yaml@main + secrets: inherit + with: + component: grafana diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml deleted file mode 100644 index 8b9287dd..00000000 --- a/.github/workflows/issues.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Issues - -on: [issues] - -jobs: - update: - name: Update Issue - runs-on: ubuntu-latest - steps: - - name: Dump Github Context - run: | - echo "update=false" >> $GITHUB_ENV - if [ ${{ github.event_name }} != "issues" ]; then - echo "This action only operates on issues" - exit 0 - fi - echo "update=true" >> $GITHUB_ENV - - name: Determine action - run: | - if [ ${{ github.event.action }} == "opened" ]; then - echo "action=open" >> $GITHUB_ENV - fi - if [ ${{ github.event.action }} == "reopened" ]; then - echo "action=reopen" >> $GITHUB_ENV - fi - if [ ${{ github.event.action }} == "closed" ]; then - echo "action=close" >> $GITHUB_ENV - fi - - name: Determine type - run: | - if ${{ contains(github.event.*.labels.*.name, 'Type: Bug') }}; then - echo "type=bug" >> $GITHUB_ENV - else - echo "type=story" >> $GITHUB_ENV - fi - - name: Update - if: ${{ env.update == 'true' }} - env: - ID: ${{ github.event.issue.html_url }} - TITLE: ${{github.event.issue.title }} - COMPONENT: grafana - DESCRIPTION: Opened by ${{ github.event.issue.user.login }}. - run: | - data=$(jq -n \ - --arg id "$ID" \ - --arg action "${{ env.action }}" \ - --arg title "$TITLE" \ - --arg description "$DESCRIPTION" \ - --arg component "$COMPONENT" \ - --arg type "${{ env.type }}" \ - '{data: {id: $id, action: $action, title: $title, description: $description, component: $component, type: $type}}') - - curl -X POST -H 'Content-type: application/json' --data "${data}" "${{ secrets.JIRA_URL }}" diff --git a/.github/workflows/promote.yaml b/.github/workflows/promote.yaml index f3b2ee56..afb45b73 100644 --- a/.github/workflows/promote.yaml +++ b/.github/workflows/promote.yaml @@ -14,7 +14,7 @@ on: jobs: promote: name: Promote - uses: canonical/observability/.github/workflows/promote-charm.yaml@main + uses: canonical/observability/.github/workflows/charm-promote.yaml@main with: promotion: ${{ github.event.inputs.promotion }} secrets: inherit diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 719afcab..1080b5fd 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -8,6 +8,5 @@ on: jobs: pull-request: name: PR - uses: canonical/observability/.github/workflows/pull-request.yaml@main + uses: canonical/observability/.github/workflows/charm-pull-request.yaml@main secrets: inherit - diff --git a/.github/workflows/release-edge.yaml b/.github/workflows/release-edge.yaml deleted file mode 100644 index abdf3bbf..00000000 --- a/.github/workflows/release-edge.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: Release to Edge - -on: - push: - branches: - - main - -jobs: - release: - uses: canonical/observability/.github/workflows/release-charm.yaml@main - secrets: inherit diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml deleted file mode 100644 index c76a882e..00000000 --- a/.github/workflows/release-libs.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: Release Libraries - -on: - push: - branches: - - main - -jobs: - release-libs: - uses: canonical/observability/.github/workflows/release-libs.yaml@main - secrets: inherit diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..7b491387 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,11 @@ +name: Release Charm to Edge and Publish Libraries + +on: + push: + branches: + - main + +jobs: + release: + uses: canonical/observability/.github/workflows/charm-release.yaml@main + secrets: inherit diff --git a/.github/workflows/update-libs.yaml b/.github/workflows/update-libs.yaml index 8828a8b1..46b56bcd 100644 --- a/.github/workflows/update-libs.yaml +++ b/.github/workflows/update-libs.yaml @@ -9,6 +9,6 @@ on: jobs: update-lib: name: Check libraries - uses: canonical/observability/.github/workflows/update-libs.yaml@main + uses: canonical/observability/.github/workflows/charm-update-libs.yaml@main secrets: inherit