Prerelease pipeline #81
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: | |
- '*' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GPG_MAIL: '[email protected]' | |
GPG_PASSPHRASE: ${{ secrets.OHAI_GPG_PASSPHRASE }} | |
GPG_PRIVATE_KEY_BASE64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded | |
PFX_CERTIFICATE_BASE64: ${{ secrets.OHAI_PFX_CERTIFICATE_BASE64 }} # base64 encoded | |
PFX_CERTIFICATE_DESCRIPTION: 'New Relic' | |
PFX_PASSPHRASE: ${{ secrets.OHAI_PFX_PASSPHRASE }} | |
TAG: ${{ github.event.release.tag_name }} | |
DOCKER_HUB_ID: ${{ secrets.OHAI_DOCKER_HUB_ID }} | |
DOCKER_HUB_PASSWORD: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} | |
SCHEMA_BRANCH: ${{ github.event.release.tag_name }} | |
AWS_S3_BUCKET_NAME: "nr-downloads-ohai-staging" | |
AWS_S3_LOCK_BUCKET_NAME: "onhost-ci-lock-staging" | |
AWS_REGION: "us-east-1" | |
jobs: | |
unit-test-linux: | |
name: Linux unit tests | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ env.DOCKER_HUB_ID }} | |
password: ${{ env.DOCKER_HUB_PASSWORD }} | |
- name: Running unit tests | |
run: make ci/test | |
test-go-linux-jdk8: | |
name: Linux unit tests for Go on JDK 8 | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'gojmx/go.mod' | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ env.DOCKER_HUB_ID }} | |
password: ${{ env.DOCKER_HUB_PASSWORD }} | |
- name: Running unit tests | |
run: make ci/go-test | |
test-go-linux-jdk11: | |
name: Linux unit tests for Go on JDK 11 | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'gojmx/go.mod' | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ env.DOCKER_HUB_ID }} | |
password: ${{ env.DOCKER_HUB_PASSWORD }} | |
- name: Running unit tests | |
run: make ci/go-test-jdk11 | |
check-gen-code: | |
name: Checking generated code | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ env.DOCKER_HUB_ID }} | |
password: ${{ env.DOCKER_HUB_PASSWORD }} | |
- name: Checking generated code | |
run: make ci/check-gen-code | |
packaging: | |
name: Build and upload artifacts into GH Release assets | |
runs-on: ubuntu-20.04 | |
needs: [ unit-test-linux, test-go-linux-jdk8, test-go-linux-jdk11, check-gen-code ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ env.DOCKER_HUB_ID }} | |
password: ${{ env.DOCKER_HUB_PASSWORD }} | |
- name: Releasing packages | |
run: make ci/release | |
packaging-msi: | |
name: Build and upload MSI packages into GH Release assets | |
runs-on: windows-2019 | |
needs: [ packaging ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Get PFX certificate from GH secrets | |
shell: bash | |
run: printf "%s" "$PFX_CERTIFICATE_BASE64" | base64 -d - > wincert.pfx | |
- name: Import PFX certificate | |
shell: pwsh | |
run: build\windows\import_certificates.ps1 -pfx_passphrase "$env:PFX_PASSPHRASE" -pfx_certificate_description "$env:PFX_CERTIFICATE_DESCRIPTION" | |
- name: Build MSI amd64 | |
shell: pwsh | |
run: build\windows\package_msi.ps1 -arch amd64 -tag ${{env.TAG}} | |
- name: Upload MSI to GH | |
shell: bash | |
run: build/upload_artifacts_gh.sh | |
# publishing-to-s3: | |
# name: Publish linux artifacts into s3 staging bucket | |
# runs-on: ubuntu-20.04 | |
# needs: [ packaging, packaging-msi ] | |
# steps: | |
# - name: Login to DockerHub | |
# uses: docker/login-action@v1 | |
# with: | |
# username: ${{ env.DOCKER_HUB_ID }} | |
# password: ${{ env.DOCKER_HUB_PASSWORD }} | |
# - name: Publish all to S3 action | |
# uses: newrelic/infrastructure-publish-action@v1 | |
# env: | |
# AWS_ACCESS_KEY_ID: ${{ secrets.OHAI_AWS_ACCESS_KEY_ID_STAGING }} | |
# AWS_SECRET_ACCESS_KEY: ${{ secrets.OHAI_AWS_SECRET_ACCESS_KEY_STAGING }} | |
# AWS_ROLE_ARN: ${{ secrets.OHAI_AWS_ROLE_ARN_STAGING }} | |
# AWS_ROLE_SESSION_NAME: ${{ secrets.OHAI_AWS_ROLE_SESSION_NAME_STAGING }} | |
# with: | |
# tag: ${{env.TAG}} | |
# app_name: "nrjmx" | |
# repo_name: "newrelic/nrjmx" | |
# schema: "nrjmx" | |
# aws_access_key_id: ${{ env.AWS_ACCESS_KEY_ID }} | |
# aws_secret_access_key: ${{ env.AWS_SECRET_ACCESS_KEY }} | |
# aws_s3_bucket_name: ${{ env.AWS_S3_BUCKET_NAME }} | |
# aws_s3_lock_bucket_name: ${{ env.AWS_S3_LOCK_BUCKET_NAME }} | |
# access_point_host: "staging" | |
# run_id: ${{ github.run_id }} | |
# aws_region: ${{ env.AWS_REGION }} | |
# aws_role_session_name: ${{ env.AWS_ROLE_SESSION_NAME }} | |
# aws_role_arn: ${{ env.AWS_ROLE_ARN }} | |
# # used for signing package stuff | |
# gpg_passphrase: ${{ env.GPG_PASSPHRASE }} | |
# gpg_private_key_base64: ${{ env.GPG_PRIVATE_KEY_BASE64 }} |