feat(ci): add win32 build #120
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: CI Build | |
on: [push,pull_request,workflow_dispatch] | |
jobs: | |
build-settings: | |
runs-on: ubuntu-latest | |
outputs: | |
semver: ${{ steps.get_settings.outputs.semver }} | |
version: ${{ steps.get_settings.outputs.version }} | |
steps: | |
- name: Checkout Sysdig | |
uses: actions/checkout@v3 | |
- name: Get settings for this release | |
id: get_settings | |
shell: python | |
run: | | |
import os | |
import json | |
ref_name = '${{ github.ref_name }}-${{ github.run_number }}'.replace('/','-') | |
with open("package.json","r") as f: | |
v = json.load(f)['version'] | |
version = f'{v}-{ref_name}' | |
semver = f'{v}' | |
with open(os.environ['GITHUB_OUTPUT'], 'a') as ofp: | |
print(f'version={version}'.lower(), file=ofp) | |
print(f'semver={semver}'.lower(), file=ofp) | |
update-builder: | |
env: | |
REGISTRY: ghcr.io | |
BUILDER_IMAGE: ghcr.io/draios/sysdig-inspect-builder | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Sysdig | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Github Packages | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build new builder | |
id: build-skeleton-builder | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: build/Dockerfile | |
tags: ${{ format('{0}:dev,{0}:{1}', env.BUILDER_IMAGE, github.sha) }} | |
push: true | |
build-sysdig-inspect: | |
needs: [build-settings, update-builder] | |
env: | |
BUILDER: "ghcr.io/draios/sysdig-inspect-builder:dev" | |
SEMVER: ${{ needs.build-settings.outputs.semver }} | |
VERSION: ${{ needs.build-settings.outputs.version }} | |
runs-on: ubuntu-latest | |
container: | |
image: "ghcr.io/draios/sysdig-inspect-builder:dev" | |
env: | |
INSTALL_DEPS: true | |
GIT_BRANCH: dev | |
SEMVER: ${{ needs.build-settings.outputs.semver }} | |
VERSION: ${{ needs.build-settings.outputs.version }} | |
BUILD_MAC: true | |
BUILD_WIN32: true | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
steps: | |
- name: Checkout Sysdig | |
uses: actions/checkout@v3 | |
- name: Build sysdig-inspect | |
run: ./build/build.sh | |
- name: Upload artifacts rpm | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sysdig-inspect-${{ env.VERSION }}-linux-x86_64.rpm | |
path: | | |
out/linux/installers/sysdig-inspect-linux-x86_64.rpm | |
- name: Upload artifacts deb | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sysdig-inspect-${{ env.VERSION }}-linux-x86_64.deb | |
path: | | |
out/linux/installers/sysdig-inspect-linux-x86_64.deb | |
- name: Upload artifacts dmg | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sysdig-inspect-${{ env.VERSION }}-mac-x86_64.dmg | |
path: | | |
out/mac/binaries/sysdig-inspect-${{ env.SEMVER }}-mac-86_64.dmg | |
- name: Upload artifacts zip | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sysdig-inspect-${{ env.VERSION }}-mac-x86_64.zip | |
path: | | |
out/mac/binaries/sysdig-inspect-mac-x86_64.zip | |