From 77fa66c8e0c21d0aceea9832bdca788bc89994cb Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 18 Jun 2024 15:28:43 +0200 Subject: [PATCH] github-actions: use nuget/feedz and slack bot github secrets (#405) --- .github/workflows/release-main.yml | 23 +++++------------------ .github/workflows/release.yml | 29 +++++++---------------------- 2 files changed, 12 insertions(+), 40 deletions(-) diff --git a/.github/workflows/release-main.yml b/.github/workflows/release-main.yml index c68f86e9..cf19fa29 100644 --- a/.github/workflows/release-main.yml +++ b/.github/workflows/release-main.yml @@ -36,19 +36,8 @@ jobs: with: subject-path: "${{ github.workspace }}/build/output/*.nupkg" - - name: Prepare feedz.io - uses: hashicorp/vault-action@v3.0.0 - with: - url: ${{ secrets.VAULT_ADDR }} - method: approle - roleId: ${{ secrets.VAULT_ROLE_ID }} - secretId: ${{ secrets.VAULT_SECRET_ID }} - secrets: | - secret/apm-team/ci/elastic-observability-feedz.io apiKey | REPO_API_KEY ; - secret/apm-team/ci/elastic-observability-feedz.io url | REPO_API_URL - - name: Release to feedz.io - run: dotnet nuget push 'build/output/*.nupkg' -k ${REPO_API_KEY} -s ${REPO_API_URL} --skip-duplicate --no-symbols + run: dotnet nuget push 'build/output/*.nupkg' -k ${{ secrets.FEEDZ_IO_API_KEY }} -s ${{ secrets.FEEDZ_IO_API_URL }} --skip-duplicate --no-symbols - name: publish canary packages github package repository shell: bash @@ -65,12 +54,10 @@ jobs: path: build/output/*.nupkg - if: ${{ failure() }} - uses: elastic/apm-pipeline-library/.github/actions/slack-message@current + uses: elastic/oblt-actions/slack/send@v1 with: - url: ${{ secrets.VAULT_ADDR }} - roleId: ${{ secrets.VAULT_ROLE_ID }} - secretId: ${{ secrets.VAULT_SECRET_ID }} - channel: "#apm-agent-dotnet" + bot-token: ${{ secrets.SLACK_BOT_TOKEN }} + channel-id: "#apm-agent-dotnet" message: | :large_yellow_circle: [${{ github.repository }}] Snapshot could not be published to feedz.io. - Build: (<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>) \ No newline at end of file + Build: (<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 05874392..7c9cda06 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,19 +41,8 @@ jobs: with: subject-path: "${{ github.workspace }}/build/output/*.nupkg" - - name: Prepare Nuget - uses: hashicorp/vault-action@v3.0.0 - with: - url: ${{ secrets.VAULT_ADDR }} - method: approle - roleId: ${{ secrets.VAULT_ROLE_ID }} - secretId: ${{ secrets.VAULT_SECRET_ID }} - secrets: | - secret/apm-team/ci/elastic-observability-nuget apiKey | REPO_API_KEY ; - secret/apm-team/ci/elastic-observability-nuget url | REPO_API_URL - - name: Release to Nuget - run: dotnet nuget push 'build/output/*.nupkg' -k ${REPO_API_KEY} -s ${REPO_API_URL} --skip-duplicate --no-symbols + run: dotnet nuget push 'build/output/*.nupkg' -k ${{ secrets.NUGET_API_KEY }} -s ${{ secrets.NUGET_API_URL }} --skip-duplicate --no-symbols - name: Store artifacts if: success() @@ -63,23 +52,19 @@ jobs: path: build/output/*.nupkg - if: ${{ success() }} - uses: elastic/apm-pipeline-library/.github/actions/slack-message@current + uses: elastic/oblt-actions/slack/send@v1 with: - url: ${{ secrets.VAULT_ADDR }} - roleId: ${{ secrets.VAULT_ROLE_ID }} - secretId: ${{ secrets.VAULT_SECRET_ID }} - channel: "#apm-agent-dotnet" + bot-token: ${{ secrets.SLACK_BOT_TOKEN }} + channel-id: "#apm-agent-dotnet" message: | :large_green_circle: [${{ github.repository }}] Release *${{ github.ref_name }}* published. Build: (<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>) - if: ${{ failure() }} - uses: elastic/apm-pipeline-library/.github/actions/slack-message@current + uses: elastic/oblt-actions/slack/send@v1 with: - url: ${{ secrets.VAULT_ADDR }} - roleId: ${{ secrets.VAULT_ROLE_ID }} - secretId: ${{ secrets.VAULT_SECRET_ID }} - channel: "#apm-agent-dotnet" + bot-token: ${{ secrets.SLACK_BOT_TOKEN }} + channel-id: "#apm-agent-dotnet" message: | :large_yellow_circle: [${{ github.repository }}] Release *${{ github.ref_name }}* could not be published. Build: (<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>)