forked from newrelic/nri-oracledb
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (99 loc) · 3.85 KB
/
prerelease.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Prerelease pipeline
on:
release:
types:
- prereleased
tags:
- 'v*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO_VERSION: '1.18'
INTEGRATION: "oracledb"
ORIGINAL_REPO_NAME: 'newrelic/nri-oracledb'
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-20.04
steps:
- uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.OHAI_DOCKER_HUB_ID }}
password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }}
- name: Unit tests
run: make ci/test
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-20.04
needs: [test-nix]
steps:
- uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.OHAI_DOCKER_HUB_ID }}
password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }}
- name: Pre release
run: make ci/prerelease
env:
GPG_MAIL: '[email protected]'
GPG_PASSPHRASE: ${{ secrets.OHAI_GPG_PASSPHRASE }}
GPG_PRIVATE_KEY_BASE64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded
- name: Notify failure via Slack
if: ${{ failure() }}
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.REPO_FULL_NAME }}`: prerelease pipeline failed."
- name: Test package installability
uses: newrelic/integrations-pkg-test-action/linux@v1
with:
tag: ${{ env.TAG }}
integration: nri-${{ env.INTEGRATION }}
publish-to-s3:
name: Send release assets to S3
runs-on: ubuntu-20.04
needs: [prerelease]
steps:
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.OHAI_DOCKER_HUB_ID }}
password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }}
- name: Publish to S3 action
uses: newrelic/infrastructure-publish-action@v1
env:
AWS_S3_BUCKET_NAME: "nr-downloads-ohai-staging"
AWS_S3_LOCK_BUCKET_NAME: "onhost-ci-lock-staging"
with:
disable_lock: false
run_id: ${{ github.run_id }}
tag: ${{env.TAG}}
app_name: "nri-${{env.INTEGRATION}}"
repo_name: ${{ env.ORIGINAL_REPO_NAME }}
access_point_host: "staging"
schema: "custom"
schema_url: "https://raw.githubusercontent.com/newrelic/nri-${{ env.INTEGRATION }}/${{ env.TAG }}/build/s3-publish-schema.yml"
aws_region: "us-east-1"
aws_role_arn: ${{ secrets.OHAI_AWS_ROLE_ARN_STAGING }}
aws_role_session_name: ${{ secrets.OHAI_AWS_ROLE_SESSION_NAME_STAGING }}
aws_access_key_id: ${{ secrets.OHAI_AWS_ACCESS_KEY_ID_STAGING }}
aws_secret_access_key: ${{ secrets.OHAI_AWS_SECRET_ACCESS_KEY_STAGING }}
aws_s3_bucket_name: ${{ env.AWS_S3_BUCKET_NAME }}
# used for locking in case of concurrent releases
aws_s3_lock_bucket_name: ${{ env.AWS_S3_LOCK_BUCKET_NAME }}
# used for signing package stuff
gpg_passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }}
gpg_private_key_base64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }}
- name: Test uploaded package installability
uses: newrelic/integrations-pkg-test-action/linux@v1
with:
tag: ${{ env.TAG }}
integration: nri-${{ env.INTEGRATION }}
packageLocation: repo
stagingRepo: true
upgrade: false