v1.9.1 #28
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Prerelease pipeline | |
on: | |
release: | |
types: | |
- prereleased | |
tags: | |
- 'v*' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
INTEGRATION: "discovery-kubernetes" | |
ORIGINAL_REPO_NAME: 'newrelic/nri-discovery-kubernetes' | |
REPO_FULL_NAME: ${{ github.event.repository.full_name }} | |
TAG: ${{ github.event.release.tag_name }} | |
jobs: | |
test-nix: | |
name: Run unit tests on *Nix | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Unit tests | |
run: make ci/test | |
test-windows: | |
name: Run unit tests on Windows | |
runs-on: windows-latest | |
env: | |
GOPATH: ${{ github.workspace }} | |
defaults: | |
run: | |
working-directory: src/github.com/${{ env.ORIGINAL_REPO_NAME }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: src/github.com/${{ env.ORIGINAL_REPO_NAME }} | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "src/github.com/${{env.ORIGINAL_REPO_NAME}}/go.mod" | |
- name: Running unit tests | |
shell: pwsh | |
run: | | |
.\build\windows\unit_tests.ps1 | |
prerelease: | |
name: Build binary for *Nix/Win, create archives for *Nix/Win, create packages for *Nix, upload all artifacts into GH Release assets | |
runs-on: ubuntu-latest | |
needs: [test-nix, test-windows] | |
env: | |
GPG_MAIL: 'infrastructure-eng@newrelic.com' | |
GPG_PASSPHRASE: ${{ secrets.OHAI_GPG_PASSPHRASE }} | |
GPG_PRIVATE_KEY_BASE64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pre release | |
run: make ci/prerelease | |
- if: ${{ github.event.release.prerelease }} | |
name: Update title for successful pre-release | |
env: | |
GH_TOKEN: "${{ secrets.COREINT_BOT_TOKEN }}" | |
run: | | |
gh release edit ${{ github.event.release.tag_name }} --title "${{ github.event.release.tag_name }}" | |
notify-failure: | |
if: ${{ always() && failure() }} | |
needs: [prerelease] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Notify failure via Slack | |
uses: archive/github-actions-slack@master | |
with: | |
slack-bot-user-oauth-access-token: ${{ secrets.COREINT_SLACK_TOKEN }} | |
slack-channel: ${{ secrets.COREINT_SLACK_CHANNEL }} | |
slack-text: "❌ `${{ env.ORIGINAL_REPO_NAME }}`: [release pipeline failed](${{ github.server_url }}/${{ env.ORIGINAL_REPO_NAME }}/actions/runs/${{ github.run_id }})." | |
update-title-on-failure: | |
if: ${{ always() && failure() }} | |
needs: [prerelease] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Reflect failure in release title | |
env: | |
GH_TOKEN: "${{ secrets.COREINT_BOT_TOKEN }}" | |
run: | | |
gh release edit ${{ github.event.release.tag_name }} --title "${{ github.event.release.tag_name }} (pre-release-failure)" |