summaryrefslogtreecommitdiffstats
path: root/.github/workflows/build.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/build.yml')
-rw-r--r--.github/workflows/build.yml313
1 files changed, 132 insertions, 181 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3a253c0c..6add5869 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -35,7 +35,7 @@ jobs:
submodules: recursive
- name: Check source files
id: check-source-files
- uses: tj-actions/changed-files@v44
+ uses: tj-actions/changed-files@v45
with:
since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
files: |
@@ -54,7 +54,7 @@ jobs:
**/*.md
- name: Check build files
id: check-build-files
- uses: tj-actions/changed-files@v44
+ uses: tj-actions/changed-files@v45
with:
since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
files: |
@@ -275,12 +275,119 @@ jobs:
&& needs.file-check.outputs.run == 'true'
}}
+ windows-build: # Test building on Windows
+ name: Test building on Windows
+ runs-on: windows-latest
+ needs:
+ - file-check
+ steps:
+ - name: Skip Check
+ id: skip
+ if: needs.file-check.outputs.run != 'true'
+ run: Write-Output "SKIPPED"
+ - name: Checkout
+ uses: actions/checkout@v4
+ id: checkout
+ if: needs.file-check.outputs.run == 'true'
+ with:
+ submodules: recursive
+ lfs: true
+ - name: Set Up Go
+ id: golang
+ if: needs.file-check.outputs.run == 'true'
+ uses: actions/setup-go@v5
+ with:
+ go-version: "^1.23"
+ - name: Set Up Dependencies
+ id: deps
+ if: needs.file-check.outputs.run == 'true'
+ run: ./packaging/windows/install-dependencies.ps1
+ - name: Build Netdata
+ id: build
+ if: needs.file-check.outputs.run == 'true'
+ env:
+ BUILD_DIR: ${{ github.workspace }}\build
+ run: ./packaging/windows/build.ps1
+ - name: Sign Agent Code
+ id: sign-agent
+ if: needs.file-check.outputs.run == 'true' && github.event_name != 'pull_request'
+ uses: azure/trusted-signing-action@v0.5.0
+ with:
+ azure-tenant-id: ${{ secrets.CODE_SIGNING_TENNANT_ID }}
+ azure-client-id: ${{ secrets.CODE_SIGNING_CLIENT_ID }}
+ azure-client-secret: ${{ secrets.CODE_SIGNING_CLIENT_SECRET }}
+ endpoint: "https://eus.codesigning.azure.net/"
+ trusted-signing-account-name: Netdata
+ certificate-profile-name: Netdata
+ files-folder: ${{ github.workspace }}\build
+ files-folder-filter: exe,dll
+ files-folder-recurse: true
+ file-digest: SHA256
+ timestamp-rfc3161: "http://timestamp.acs.microsoft.com"
+ timestamp-digest: SHA256
+ - name: Package Netdata
+ id: package
+ if: needs.file-check.outputs.run == 'true'
+ env:
+ BUILD_DIR: ${{ github.workspace }}\build
+ run: ./packaging/windows/package.ps1
+ - name: Sign Installer
+ id: sign-installer
+ if: needs.file-check.outputs.run == 'true' && github.event_name != 'pull_request'
+ uses: azure/trusted-signing-action@v0.5.0
+ with:
+ azure-tenant-id: ${{ secrets.CODE_SIGNING_TENNANT_ID }}
+ azure-client-id: ${{ secrets.CODE_SIGNING_CLIENT_ID }}
+ azure-client-secret: ${{ secrets.CODE_SIGNING_CLIENT_SECRET }}
+ endpoint: "https://eus.codesigning.azure.net/"
+ trusted-signing-account-name: Netdata
+ certificate-profile-name: Netdata
+ files-folder: ${{ github.workspace }}\packaging\windows
+ files-folder-filter: msi
+ file-digest: SHA256
+ timestamp-rfc3161: "http://timestamp.acs.microsoft.com"
+ timestamp-digest: SHA256
+ - name: Upload Installer
+ id: upload
+ uses: actions/upload-artifact@v4.4.2
+ with:
+ name: windows-x86_64-installer
+ path: packaging\windows\netdata*.msi
+ retention-days: 30
+ - name: Failure Notification
+ uses: rtCamp/action-slack-notify@v2
+ env:
+ SLACK_COLOR: 'danger'
+ SLACK_FOOTER: ''
+ SLACK_ICON_EMOJI: ':github-actions:'
+ SLACK_TITLE: 'Windows build failed:'
+ SLACK_USERNAME: 'GitHub Actions'
+ SLACK_MESSAGE: |-
+ ${{ github.repository }}: Updater checks for ${{ matrix.distro }} failed.
+ Checkout: ${{ steps.checkout.outcome }}
+ Set Up Dependencies: ${{ steps.deps.outcome }}
+ Build Netdata: ${{ steps.build.outcome }}
+ Sign Agent Code: ${{ steps.sign-agent.outcome }}
+ Package Netdata: ${{ steps.package.outcome }}
+ Sign Installer: ${{ steps.sign-installer.outcome }}
+ Upload Installer: ${{ steps.upload.outcome }}
+ SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
+ if: >-
+ ${{
+ failure()
+ && startsWith(github.ref, 'refs/heads/master')
+ && github.event_name != 'pull_request'
+ && github.repository == 'netdata/netdata'
+ && needs.file-check.outputs.run == 'true'
+ }}
+
prepare-upload: # Consolidate the artifacts for uploading or releasing.
name: Prepare Artifacts
runs-on: ubuntu-latest
needs:
- build-dist
- build-static
+ - windows-build
- file-check
steps:
- name: Skip Check
@@ -307,6 +414,18 @@ jobs:
merge-multiple: true
attempt_limit: 3
attempt_delay: 2000
+ - name: Retrieve Windows Artifacts
+ id: fetch-windows
+ if: needs.file-check.outputs.run == 'true'
+ uses: Wandalen/wretry.action@v3
+ with:
+ action: actions/download-artifact@v4
+ with: |
+ pattern: windows-*-installer
+ path: dist-artifacts
+ merge-multiple: true
+ attempt_limit: 3
+ attempt_delay: 2000
- name: Prepare Artifacts
id: consolidate
if: needs.file-check.outputs.run == 'true'
@@ -338,7 +457,8 @@ jobs:
${{ github.repository }}: Failed to prepare release artifacts for upload.
Checkout: ${{ steps.checkout.outcome }}
Prepare environment: ${{ steps.prepare.outcome }}
- Fetch dist tarball: ${{ steps.fetch-dist.outcome }}
+ Fetch dist artifacts: ${{ steps.fetch-dist.outcome }}
+ Fetch Windows installers: ${{ steps.fetch-windows.outcome }}
Consolidate artifacts: ${{ steps.consolidate.outcome }}
Store: ${{ steps.store.outcome }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
@@ -489,68 +609,12 @@ jobs:
&& needs.file-check.outputs.run == 'true'
}}
- upload-nightly: # Upload the nightly build artifacts to GCS.
- name: Upload Nightly Artifacts
- runs-on: ubuntu-latest
- if: github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'nightly' && github.repository == 'netdata/netdata'
- needs:
- - artifact-verification-dist
- - artifact-verification-static
- steps:
- - name: Retrieve Artifacts
- id: fetch
- uses: Wandalen/wretry.action@v3
- with:
- action: actions/download-artifact@v4
- with: |
- name: final-artifacts
- path: final-artifacts
- attempt_limit: 3
- attempt_delay: 2000
- - name: Authenticate to GCS
- id: gcs-auth
- uses: google-github-actions/auth@v2
- with:
- project_id: ${{ secrets.GCP_NIGHTLY_STORAGE_PROJECT }}
- credentials_json: ${{ secrets.GCS_STORAGE_SERVICE_KEY_JSON }}
- - name: Setup GCS
- id: gcs-setup
- uses: google-github-actions/setup-gcloud@v2.1.1
- - name: Upload Artifacts
- id: upload
- uses: google-github-actions/upload-cloud-storage@v2.1.2
- with:
- destination: ${{ secrets.GCP_NIGHTLY_STORAGE_BUCKET }}
- gzip: false
- path: ./final-artifacts/latest-version.txt
- parent: false
- - name: Failure Notification
- uses: rtCamp/action-slack-notify@v2
- env:
- SLACK_COLOR: 'danger'
- SLACK_FOOTER: ''
- SLACK_ICON_EMOJI: ':github-actions:'
- SLACK_TITLE: 'Failed to upload nightly release artifacts:'
- SLACK_USERNAME: 'GitHub Actions'
- SLACK_MESSAGE: |-
- ${{ github.repository }}: Failed to upload nightly release artifacts.
- Fetch artifacts: ${{ steps.fetch.outcome }}
- Authenticatie GCS: ${{ steps.gcs-auth.outcome }}
- Setup GCS: ${{ steps.gcs-setup.outcome }}
- Upload artifacts: ${{ steps.upload.outcome }}
- SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
- if: >-
- ${{
- failure()
- && startsWith(github.ref, 'refs/heads/master')
- && github.event_name != 'pull_request'
- }}
-
create-nightly: # Create a nightly build release in netdata/netdata-nightlies
name: Create Nightly Release
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'nightly' && github.repository == 'netdata/netdata'
needs:
+ - prepare-upload
- artifact-verification-dist
- artifact-verification-static
steps:
@@ -589,7 +653,7 @@ jobs:
with:
allowUpdates: false
artifactErrorsFailBuild: true
- artifacts: 'final-artifacts/sha256sums.txt,final-artifacts/netdata-*.tar.gz,final-artifacts/netdata-*.gz.run,final-artifacts/integrations.js'
+ artifacts: 'final-artifacts/sha256sums.txt,final-artifacts/netdata-*.tar.gz,final-artifacts/netdata-*.gz.run,final-artifacts/netdata-*.msi,final-artifacts/integrations.js'
owner: netdata
repo: netdata-nightlies
body: Netdata nightly build for ${{ steps.version.outputs.date }}.
@@ -707,7 +771,7 @@ jobs:
with:
allowUpdates: false
artifactErrorsFailBuild: true
- artifacts: 'final-artifacts/sha256sums.txt,final-artifacts/netdata-*.tar.gz,final-artifacts/netdata-*.gz.run,final-artifacts/integrations.js'
+ artifacts: 'final-artifacts/sha256sums.txt,final-artifacts/netdata-*.tar.gz,final-artifacts/netdata-*.gz.run,final-artifacts/netdata-*.msi,final-artifacts/integrations.js'
draft: true
tag: ${{ needs.normalize-tag.outputs.tag }}
token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
@@ -930,24 +994,18 @@ jobs:
id: load
if: needs.file-check.outputs.run == 'true'
run: docker load --input image.tar
- - name: netdata-installer on ${{ matrix.distro }}, disable cloud
- id: build-no-cloud
- if: needs.file-check.outputs.run == 'true'
- run: |
- docker run --security-opt seccomp=unconfined -w /netdata test:${{ matrix.artifact_key }} \
- /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --disable-cloud --one-time-build ${{ needs.file-check.outputs.skip-go }}'
- name: netdata-installer on ${{ matrix.distro }}, require cloud
id: build-cloud
if: needs.file-check.outputs.run == 'true'
run: |
docker run --security-opt seccomp=unconfined -w /netdata test:${{ matrix.artifact_key }} \
- /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --require-cloud --one-time-build ${{ needs.file-check.outputs.skip-go }}'
+ /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --one-time-build ${{ needs.file-check.outputs.skip-go }}'
- name: netdata-installer on ${{ matrix.distro }}, require cloud, no JSON-C
id: build-no-jsonc
if: matrix.jsonc_removal != '' && needs.file-check.outputs.run == 'true'
run: |
docker run --security-opt seccomp=unconfined -w /netdata test:${{ matrix.artifact_key }} \
- /bin/sh -c '/rmjsonc.sh && ./netdata-installer.sh --dont-wait --dont-start-it --require-cloud --one-time-build ${{ needs.file-check.outputs.skip-go }}'
+ /bin/sh -c '/rmjsonc.sh && ./netdata-installer.sh --dont-wait --dont-start-it --one-time-build ${{ needs.file-check.outputs.skip-go }}'
- name: Failure Notification
uses: rtCamp/action-slack-notify@v2
env:
@@ -961,8 +1019,7 @@ jobs:
Checkout: ${{ steps.checkout.outcome }}
Fetch test environment: ${{ steps.fetch.outcome }}
Load test environment: ${{ steps.load.outcome }}
- netdata-installer, disable cloud: ${{ steps.build-no-cloud.outcome }}
- netdata-installer, require cloud: ${{ steps.build-cloud.outcome }}
+ netdata-installer: ${{ steps.build-cloud.outcome }}
netdata-installer, no JSON-C: ${{ steps.build-no-jsonc.outcome }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
if: >-
@@ -985,12 +1042,12 @@ jobs:
max-parallel: 8
matrix:
include:
- - name: macos-12
- runner: macos-12
- name: macos-13
runner: macos-13
- name: macos-14-M1
runner: macos-14
+ - name: macos-15-M1
+ runner: macos-15
steps:
- name: Skip Check
id: skip
@@ -1015,7 +1072,7 @@ jobs:
id: build-source
if: needs.file-check.outputs.run == 'true'
run: |
- sudo bash ./netdata-installer.sh --install-no-prefix /usr/local/netdata --dont-wait --dont-start-it --require-cloud --one-time-build
+ sudo bash ./netdata-installer.sh --install-no-prefix /usr/local/netdata --dont-wait --dont-start-it --one-time-build
- name: Test Agent start up
id: test-agent
if: needs.file-check.outputs.run == 'true'
@@ -1046,112 +1103,6 @@ jobs:
&& github.repository == 'netdata/netdata'
}}
- windows-build: # Test building on Windows
- name: Test building on Windows
- runs-on: windows-latest
- if: github.event_name != 'workflow_dispatch'
- needs:
- - file-check
- steps:
- - name: Skip Check
- id: skip
- if: needs.file-check.outputs.run != 'true'
- run: Write-Output "SKIPPED"
- - name: Checkout
- uses: actions/checkout@v4
- id: checkout
- if: needs.file-check.outputs.run == 'true'
- with:
- submodules: recursive
- lfs: true
- - name: Set Up Go
- id: golang
- if: needs.file-check.outputs.run == 'true'
- uses: actions/setup-go@v5
- with:
- go-version: "^1.22"
- - name: Set Up Dependencies
- id: deps
- if: needs.file-check.outputs.run == 'true'
- run: ./packaging/windows/install-dependencies.ps1
- - name: Build Netdata
- id: build
- if: needs.file-check.outputs.run == 'true'
- env:
- BUILD_DIR: ${{ github.workspace }}\build
- run: ./packaging/windows/build.ps1
- - name: Sign Agent Code
- id: sign-agent
- if: needs.file-check.outputs.run == 'true' && github.event_name != 'pull_request'
- uses: azure/trusted-signing-action@v0.4.0
- with:
- azure-tenant-id: ${{ secrets.CODE_SIGNING_TENNANT_ID }}
- azure-client-id: ${{ secrets.CODE_SIGNING_CLIENT_ID }}
- azure-client-secret: ${{ secrets.CODE_SIGNING_CLIENT_SECRET }}
- endpoint: "https://eus.codesigning.azure.net/"
- trusted-signing-account-name: Netdata
- certificate-profile-name: Netdata
- files-folder: ${{ github.workspace }}\build
- files-folder-filter: exe,dll
- files-folder-recurse: true
- file-digest: SHA256
- timestamp-rfc3161: "http://timestamp.acs.microsoft.com"
- timestamp-digest: SHA256
- - name: Package Netdata
- id: package
- if: needs.file-check.outputs.run == 'true'
- env:
- BUILD_DIR: ${{ github.workspace }}\build
- run: ./packaging/windows/package.ps1
- - name: Sign Installer
- id: sign-installer
- if: needs.file-check.outputs.run == 'true' && github.event_name != 'pull_request'
- uses: azure/trusted-signing-action@v0.4.0
- with:
- azure-tenant-id: ${{ secrets.CODE_SIGNING_TENNANT_ID }}
- azure-client-id: ${{ secrets.CODE_SIGNING_CLIENT_ID }}
- azure-client-secret: ${{ secrets.CODE_SIGNING_CLIENT_SECRET }}
- endpoint: "https://eus.codesigning.azure.net/"
- trusted-signing-account-name: Netdata
- certificate-profile-name: Netdata
- files: ${{ github.workspace }}\packaging\windows\netdata-installer.exe
- file-digest: SHA256
- timestamp-rfc3161: "http://timestamp.acs.microsoft.com"
- timestamp-digest: SHA256
- - name: Upload Installer
- id: upload
- uses: actions/upload-artifact@v4.4.2
- with:
- name: windows-x86_64-installer
- path: packaging\windows\netdata-installer.exe
- retention-days: 30
- - name: Failure Notification
- uses: rtCamp/action-slack-notify@v2
- env:
- SLACK_COLOR: 'danger'
- SLACK_FOOTER: ''
- SLACK_ICON_EMOJI: ':github-actions:'
- SLACK_TITLE: 'Windows build failed:'
- SLACK_USERNAME: 'GitHub Actions'
- SLACK_MESSAGE: |-
- ${{ github.repository }}: Updater checks for ${{ matrix.distro }} failed.
- Checkout: ${{ steps.checkout.outcome }}
- Set Up Dependencies: ${{ steps.deps.outcome }}
- Build Netdata: ${{ steps.build.outcome }}
- Sign Agent Code: ${{ steps.sign-agent.outcome }}
- Package Netdata: ${{ steps.package.outcome }}
- Sign Installer: ${{ steps.sign-installer.outcome }}
- Upload Installer: ${{ steps.upload.outcome }}
- SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
- if: >-
- ${{
- failure()
- && startsWith(github.ref, 'refs/heads/master')
- && github.event_name != 'pull_request'
- && github.repository == 'netdata/netdata'
- && needs.file-check.outputs.run == 'true'
- }}
-
updater-check: # Test the generated dist archive using the updater code.
name: Test Generated Distfile and Updater Code
runs-on: ubuntu-latest