Skip to content

Commit

Permalink
feat(feez/nuget/slack): github secrets (#2373)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Jun 5, 2024
1 parent 5491bbb commit 6e2ab10
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 39 deletions.
21 changes: 4 additions & 17 deletions .github/workflows/release-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,19 @@ jobs:

- name: Package with canary suffix
run: ./build.sh pack

- name: Prepare feedz.io
uses: hashicorp/[email protected]
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

# Github packages requires authentication, this is likely going away in the future so for now we publish to feedz.io
- name: publish canary packages to feedz.io
run: dotnet nuget push 'build/output/_packages/*.nupkg' -k ${REPO_API_KEY} -s ${REPO_API_URL} --skip-duplicate --no-symbols
run: dotnet nuget push 'build/output/_packages/*.nupkg' -k ${{ secrets.FEEDZ_IO_API_KEY }} -s ${{ secrets.FEEDZ_IO_API_URL }} --skip-duplicate --no-symbols

- name: publish canary packages github package repository
run: dotnet nuget push 'build/output/_packages/*.nupkg' -k ${{secrets.GITHUB_TOKEN}} -s https://nuget.pkg.github.com/elastic/index.json --skip-duplicate --no-symbols

- if: ${{ failure() }}
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
uses: elastic/oblt-actions/slack/[email protected]
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>)
29 changes: 7 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,8 @@ jobs:
- name: Package
run: ./build.sh pack

- name: Prepare Nuget
uses: hashicorp/[email protected]
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: .ci/linux/deploy.sh ${REPO_API_KEY} ${REPO_API_URL}
run: .ci/linux/deploy.sh ${{ secrets.NUGET_API_KEY }} ${{ secrets.NUGET_API_URL }}

- name: Log in to the Elastic Container registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
Expand Down Expand Up @@ -69,24 +58,20 @@ jobs:
gh release upload ${{ github.ref_name }} "build/output/ElasticApmAgent_${{ steps.bootstrap.outputs.agent-version }}.zip" "build/output/elastic_apm_profiler_${{ steps.bootstrap.outputs.agent-version }}-linux-x64.zip"
- if: ${{ success() }}
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
uses: elastic/oblt-actions/slack/[email protected]
with:
url: ${{ secrets.VAULT_ADDR }}
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
channel: ${{ env.SLACK_CHANNEL }}
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: ${{ env.SLACK_CHANNEL }}
message: |
:large_green_circle: [${{ github.repository }}] Release *${{ github.ref_name }}* published.
Build: (<${{ env.JOB_URL }}|here>)
Release URL: (<https://github.com/elastic/apm-agent-dotnet/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}>)
- if: ${{ failure() }}
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
uses: elastic/oblt-actions/slack/[email protected]
with:
url: ${{ secrets.VAULT_ADDR }}
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
channel: ${{ env.SLACK_CHANNEL }}
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: ${{ env.SLACK_CHANNEL }}
message: |
:large_yellow_circle: [${{ github.repository }}] Release *${{ github.ref_name }}* could not be published.
Build: (<${{ env.JOB_URL }}|here>)
Expand Down

0 comments on commit 6e2ab10

Please sign in to comment.