From 4d0cdad3a69827676fb8c4109ce193a35440abf9 Mon Sep 17 00:00:00 2001 From: Luca Bello <36242061+lucabello@users.noreply.github.com> Date: Wed, 11 Oct 2023 14:50:32 +0200 Subject: [PATCH] upkeep: use the new refactored workflows (#30) --- .github/workflows/codeql-analysis.yml | 64 --------------------------- .github/workflows/issues.yaml | 50 ++------------------- .github/workflows/promote.yaml | 2 +- .github/workflows/pull-request.yaml | 2 +- .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, 18 insertions(+), 135 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.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/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index e7996b4..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,64 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -name: "CodeQL" - -on: - push: - branches: [main] - pull_request: - # The branches below must be a subset of the branches above - branches: [main] - -permissions: - security-events: - write - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - # Override automatic language detection by changing the below list - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['python'] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/issues.yaml b/.github/workflows/issues.yaml index d3dd8d4..77314e3 100644 --- a/.github/workflows/issues.yaml +++ b/.github/workflows/issues.yaml @@ -5,49 +5,7 @@ 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: prometheus - 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 }}" + uses: canonical/observability/.github/workflows/issues.yaml@main + secrets: inherit + with: + component: mimir diff --git a/.github/workflows/promote.yaml b/.github/workflows/promote.yaml index f3b2ee5..afb45b7 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 1ec1b31..1080b5f 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -8,5 +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 abdf3bb..0000000 --- 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 c76a882..0000000 --- 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 0000000..7b49138 --- /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 8828a8b..46b56bc 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