-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathcomponent_windows_packaging.yml
More file actions
92 lines (79 loc) · 2.83 KB
/
component_windows_packaging.yml
File metadata and controls
92 lines (79 loc) · 2.83 KB
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
#TBD - some arguments were not possible to pass
name: .. 🚧 Windows | Produce packages
on:
workflow_call:
secrets:
PFX_CERTIFICATE_BASE64:
required: true
PFX_PASSPHRASE:
required: true
inputs:
PFX_CERTIFICATE_DESCRIPTION:
required: true
type: string
TAG:
required: true
type: string
GOPATH:
required: true
type: string
GITHUB_SHA:
required: true
type: string
env:
PFX_CERTIFICATE_BASE64: ${{ secrets.PFX_CERTIFICATE_BASE64 }}
PFX_PASSPHRASE: ${{ secrets.PFX_PASSPHRASE }}
PFX_CERTIFICATE_DESCRIPTION: ${{ inputs.PFX_CERTIFICATE_DESCRIPTION }}
TAG: ${{ inputs.TAG }}
GOPATH: ${{ inputs.GOPATH }}
GITHUB_SHA: ${{ inputs.GITHUB_SHA }}
REPO_WORKDIR: 'src/github.com/newrelic/infrastructure-agent'
jobs:
packaging:
name: Create MSI & Upload into GH Release assets
runs-on: windows-2025
env:
GOPATH: ${{ env.GOPATH }}
defaults:
run:
working-directory: ${{ env.REPO_WORKDIR }}
strategy:
matrix:
goarch: [ amd64 ]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ${{ env.REPO_WORKDIR }}
- name: Install Go
uses: actions/setup-go@v4
with:
go-version-file: '${{ env.REPO_WORKDIR }}/go.mod'
check-latest: true
- 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\scripts\set_cert_thumbprint_env.ps1 -PfxPassphrase "$env:PFX_PASSPHRASE" -PfxCertificateDescription "$env:PFX_CERTIFICATE_DESCRIPTION"
- name: Set date environment variable for buildDate metadata
run: echo buildDate=$(date -u +"%Y-%m-%dT%H:%M:%SZ") >> $GITHUB_ENV
shell: bash
- name: Build executables ${{ matrix.goarch }}
shell: pwsh
run: build\windows\build.ps1 -arch ${{ matrix.goarch }} -version ${{env.TAG}} -commit "$env:GITHUB_SHA" -date ${{env.buildDate}} -certThumbprint "$env:certThumbprint"
- name: Create MSI package ${{ matrix.goarch }}
shell: pwsh
run: build\windows\package_msi.ps1 -arch ${{ matrix.goarch }} -version ${{env.TAG}} -certThumbprint "$env:certThumbprint"
- name: Create zip package ${{ matrix.goarch }}
shell: pwsh
run: build\windows\package_zip.ps1 -arch ${{ matrix.goarch }} -version ${{env.TAG}}
- name: Generate checksum files
uses: ./src/github.com/newrelic/infrastructure-agent/.github/actions/generate-checksums
with:
files_regex: '.*zip\|.*msi'
files_path: './${{ env.REPO_WORKDIR }}/dist'
- name: Upload MSI to GH
shell: bash
run: build/upload_artifacts_gh.sh