From 9fcf86cf4522d8f9cecd37d044b768f14d5c5648 Mon Sep 17 00:00:00 2001 From: dfeldick Date: Fri, 10 May 2024 10:30:57 -0700 Subject: [PATCH] APIGOV-27565 - cleanup --- .github/workflows/build-agents.yml | 6 +-- .github/workflows/build-docker-images.yml | 41 +++++++++++++++----- .github/workflows/create-tag-for-release.yml | 6 +-- .github/workflows/package-helm-chart.yml | 30 -------------- .github/workflows/run-tests.yml | 1 + 5 files changed, 39 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/package-helm-chart.yml diff --git a/.github/workflows/build-agents.yml b/.github/workflows/build-agents.yml index 9fd0bca..befa8ea 100644 --- a/.github/workflows/build-agents.yml +++ b/.github/workflows/build-agents.yml @@ -16,17 +16,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - + - name: Set up Go uses: actions/setup-go@v5 with: go-version: 1.21 - + - name: Build discovery agent working-directory: . run: | make build-da - + - name: Build traceability agent working-directory: . run: | diff --git a/.github/workflows/build-docker-images.yml b/.github/workflows/build-docker-images.yml index 5bd14da..f8fa90a 100644 --- a/.github/workflows/build-docker-images.yml +++ b/.github/workflows/build-docker-images.yml @@ -29,21 +29,21 @@ jobs: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT echo "sdkversion=$(grep github.com/Axway/agent-sdk go.mod | awk '{print $2}')" >> $GITHUB_OUTPUT echo "commit=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT - + - name: Log in to the Container registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 with: flavor: latest=false images: ghcr.io/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }} - + - name: Build and push Docker image uses: docker/build-push-action@v5 with: @@ -70,7 +70,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - + - name: Set outputs id: vars run: | @@ -78,21 +78,21 @@ jobs: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT echo "sdkversion=$(grep github.com/Axway/agent-sdk go.mod | awk '{print $2}')" >> $GITHUB_OUTPUT echo "commit=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT - + - name: Log in to the Container registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 with: flavor: latest=false images: ghcr.io/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }} - + - name: Build and push Docker image uses: docker/build-push-action@v5 with: @@ -108,9 +108,33 @@ jobs: sdk_version=${{ steps.vars.outputs.sdkversion }} commit_id=${{ steps.vars.outputs.commit }} + archiveHelm: + needs: testAgents + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: olegtarasov/get-tag@v2.1.3 + id: tagName + with: + tagRegex: "v(.*)" + tagRegexGroup: 1 + - name: Update chart versions + run: | + sed helm/kong-agents/Chart.yaml -i -e "s/^appVersion.*/appVersion:\ \"v${GIT_TAG_NAME}\"/" + sed helm/kong-agents/Chart.yaml -i -e "s/^version.*/version:\ ${GIT_TAG_NAME}/" + - name: Archive chart + run: | + tar czf kong-agents.tgz -C helm/kong-agents . + - name: Upload chart to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: kong-agents.tgz + tag: ${{ github.ref_name }} + notifyTeamsChannel: runs-on: ubuntu-latest - needs: [buildDiscoveryAgentDocker, buildTraceabilityAgentDocker] + needs: [buildDiscoveryAgentDocker, buildTraceabilityAgentDocker, archiveHelm] steps: - uses: actions/checkout@v4 - name: Notify Teams channel @@ -118,4 +142,3 @@ jobs: TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }} TAG: ${{ github.ref_name }} run: ./release.sh - \ No newline at end of file diff --git a/.github/workflows/create-tag-for-release.yml b/.github/workflows/create-tag-for-release.yml index 0292747..ef16ffe 100644 --- a/.github/workflows/create-tag-for-release.yml +++ b/.github/workflows/create-tag-for-release.yml @@ -5,7 +5,7 @@ on: pull_request: types: - closed - + jobs: # only run this job if the merge name is "APIGOV-UpdateSDK", which comes from the automated release if_SDK_update_merged: @@ -20,12 +20,12 @@ jobs: # by default, this action creates a tag with a 'v' prefix, and bumps the patch version. # See https://github.com/mathieudutour/github-tag-action to customize these rules. github_token: ${{ secrets.ACTION_ACCESS_TOKEN }} - + - name: Show the new tag run: | echo "previous tag ${{ steps.tag_version.outputs.previous_tag }} echo "new tag ${{ steps.tag_version.outputs.new_tag }} - + - name: Create a GitHub release uses: ncipollo/release-action@v1 with: diff --git a/.github/workflows/package-helm-chart.yml b/.github/workflows/package-helm-chart.yml deleted file mode 100644 index 847de60..0000000 --- a/.github/workflows/package-helm-chart.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Kong Agents Helm -on: - push: - tags: - - "*" - -jobs: - helm-archive: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: olegtarasov/get-tag@v2.1.3 - id: tagName - with: - tagRegex: "v(.*)" - tagRegexGroup: 1 - - name: Update chart versions - run: | - - sed helm/kong-agents/Chart.yaml -i -e "s/^appVersion.*/appVersion:\ \"v${GIT_TAG_NAME}\"/" - sed helm/kong-agents/Chart.yaml -i -e "s/^version.*/version:\ ${GIT_TAG_NAME}/" - - name: Archive chart - run: | - tar czf kong-agents.tgz -C helm/kong-agents . - - name: Upload chart to release - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: kong-agents.tgz - tag: ${{ github.ref_name }} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b79fb11..6271ee1 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -19,3 +19,4 @@ jobs: working-directory: . run: | make test +