forked from newrelic/newrelic-php-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (91 loc) · 2.78 KB
/
release-build.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
#
# Copyright 2020 New Relic Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
#
# This is the workflow to do a release build.
#
name: release_CI
#
# Control when the action will run.
#
on:
#
# Run this workflow manually from the Actions tab or using the API
#
workflow_dispatch:
inputs:
build-number:
description: 'Build number for agent version'
required: true
type: string
jobs:
daemon_release:
env:
IMAGE_NAME: newrelic/nr-php-agent-builder
IMAGE_TAG: make-go
IMAGE_VERSION: v1
runs-on: ubuntu-latest
strategy:
matrix:
platform: [gnu, musl]
arch: [amd64]
steps:
- name: Checkout newrelic-php-agent code
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.ref }}
path: newrelic-php-agent
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build daemon
run: >
docker run --rm --platform linux/${{matrix.arch}}
-v "${GITHUB_WORKSPACE}/newrelic-php-agent":"/usr/local/src/newrelic-php-agent"
-e USE_SYSTEM_CERTS=1
-e BUILD_NUMBER=${{inputs.build-number}}
$IMAGE_NAME:$IMAGE_TAG-${{ matrix.platform }}-$IMAGE_VERSION release-daemon
- name: Save build artifacts
uses: actions/upload-artifact@v3
with:
path: newrelic-php-agent/releases
name: release-from-gha
if-no-files-found: error
agent_release:
env:
IMAGE_NAME: newrelic/nr-php-agent-builder
IMAGE_VERSION: v1
runs-on: ubuntu-latest
strategy:
matrix:
platform: [gnu, musl]
php_ver: ['8.2']
arch: [amd64]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.ref }}
path: newrelic-php-agent
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build
run: >
docker run --rm --platform linux/${{matrix.arch}}
-v "${GITHUB_WORKSPACE}/newrelic-php-agent":"/usr/local/src/newrelic-php-agent"
-e OPTIMIZE=1
-e PCRE_STATIC=yes
-e BUILD_NUMBER=${{inputs.build-number}}
$IMAGE_NAME:agent-builder-php${{matrix.php_ver}}-${{matrix.platform}}-$IMAGE_VERSION release-${{matrix.php_ver}}-gha
- name: Save build artifacts
uses: actions/upload-artifact@v3
with:
path: newrelic-php-agent/releases
name: release-from-gha
if-no-files-found: error