Skip to content

Commit

Permalink
Update dev_builds.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sarathrajsrinivasan authored Aug 19, 2024
1 parent 76cdefc commit 0178666
Showing 1 changed file with 0 additions and 343 deletions.
343 changes: 0 additions & 343 deletions .github/workflows/dev_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,346 +164,3 @@ jobs:
apple_developer_certificate_p12_base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
apple_developer_certificate_password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
app_store_connect_password: ${{ secrets.AC_PASSWORD }}

build-container-images:
name: Build container
runs-on: ubuntu-20.04
needs:
- build
- get-version
strategy:
matrix:
arch_os: ["linux_amd64", "linux_arm64"]
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/[email protected]

- name: Set up Buildx
id: buildx
uses: docker/[email protected]

- name: Show Buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Login to Open Source ECR
run: make login
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}

- name: Login to Docker Hub
run: |
docker login \
--username ${{ secrets.DOCKERHUB_LOGIN_DEV }} \
--password ${{ secrets.DOCKERHUB_PASSWORD_DEV }}
- name: Download FIPS binary action artifact from build phase
uses: actions/download-artifact@v4
with:
name: otelcol-sumo-fips-${{matrix.arch_os}}

- name: Build and push FIPS images to Open Source ECR
run: |
cp otelcol-sumo-fips-${{ matrix.arch_os }} otelcol-sumo
make build-push-container-multiplatform-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORM=${{ matrix.arch_os }} \
BUILD_TYPE_SUFFIX="-fips"
- name: Build and push FIPS images to DockerHub
run: |
cp otelcol-sumo-fips-${{ matrix.arch_os }} otelcol-sumo
make build-push-container-multiplatform-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORM=${{ matrix.arch_os }} \
REPO_URL=sumologic/sumologic-otel-collector-dev \
BUILD_TYPE_SUFFIX="-fips"
- name: Build and push UBI-based FIPS image to Open Source ECR
run: |
cp otelcol-sumo-fips-${{ matrix.arch_os }} otelcol-sumo
make build-push-container-ubi-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORM=${{ matrix.arch_os }} \
BUILD_TYPE_SUFFIX="-ubi-fips"
- name: Build and push UBI-based FIPS image to DockerHub
run: |
cp otelcol-sumo-fips-${{ matrix.arch_os }} otelcol-sumo
make build-push-container-ubi-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORM=${{ matrix.arch_os }} \
REPO_URL=sumologic/sumologic-otel-collector-dev \
BUILD_TYPE_SUFFIX="-ubi-fips"
- name: Download binary action artifact from build phase
uses: actions/download-artifact@v4
with:
name: otelcol-sumo-${{ matrix.arch_os }}

- name: Build and push image to Open Source ECR
run: |
cp otelcol-sumo-${{ matrix.arch_os }} otelcol-sumo
make build-push-container-multiplatform-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORM=${{ matrix.arch_os }}
- name: Build and push image to DockerHub
run: |
cp otelcol-sumo-${{ matrix.arch_os }} otelcol-sumo
make build-push-container-multiplatform-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORM=${{ matrix.arch_os }} \
REPO_URL=sumologic/sumologic-otel-collector-dev
- name: Build and push UBI-based image to Open Source ECR
run: |
cp otelcol-sumo-${{ matrix.arch_os }} otelcol-sumo
make build-push-container-ubi-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORM=${{ matrix.arch_os }} \
BUILD_TYPE_SUFFIX="-ubi"
- name: Build and push UBI-based image to DockerHub
run: |
cp otelcol-sumo-${{ matrix.arch_os }} otelcol-sumo
make build-push-container-ubi-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORM=${{ matrix.arch_os }} \
REPO_URL=sumologic/sumologic-otel-collector-dev \
BUILD_TYPE_SUFFIX="-ubi"
build-windows-container-images:
name: Build Windows container
runs-on: ${{ matrix.runs-on }}
needs:
- build
- get-version
strategy:
matrix:
include:
- arch_os: windows_amd64
base_image_tag: ltsc2022
runs-on: windows-2022
- arch_os: windows_amd64
base_image_tag: ltsc2019
runs-on: windows-2019
steps:
- uses: actions/checkout@v4

- name: Login to Open Source ECR
run: |
USERNAME=$(powershell.exe "echo \$Env:UserName")
# remove wincred entry and fix json format by replacing }, with }
cat "C:\\Users\\${USERNAME}\\.docker\\config.json" | grep -v "wincred" | sed 's/},$/}/' > "C:\\Users\\${USERNAME}\\.docker\\config.json.tmp"
mv "C:\\Users\\${USERNAME}\\.docker\\config.json.tmp" "C:\\Users\\${USERNAME}\\.docker\\config.json"
make login
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}

- name: Login to Docker Hub
run: |
docker login \
--username ${{ secrets.DOCKERHUB_LOGIN_DEV }} \
--password ${{ secrets.DOCKERHUB_PASSWORD_DEV }}
- name: Download binary action artifact from build phase
uses: actions/download-artifact@v4
with:
name: otelcol-sumo-${{matrix.arch_os}}.exe
path: artifacts/

- name: Build and push images to Open Source ECR
run: |
cp artifacts/otelcol-sumo-${{matrix.arch_os}}.exe otelcol-sumo.exe
make build-push-container-windows-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORM=${{ matrix.arch_os }}_${{ matrix.base_image_tag }}
- name: Build and push images to DockerHub
run: |
cp artifacts/otelcol-sumo-${{matrix.arch_os}}.exe otelcol-sumo.exe
make build-push-container-windows-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
REPO_URL=sumologic/sumologic-otel-collector-dev \
PLATFORM=${{ matrix.arch_os }}_${{ matrix.base_image_tag }}
push-docker-manifest:
name: Push joint container manifest
runs-on: ubuntu-20.04
needs:
- build-container-images
- build-windows-container-images
- get-version
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/[email protected]

- name: Set up Buildx
id: buildx
uses: docker/[email protected]

- name: Show Buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Login to Open Source ECR
run: make login
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}

- name: Login to Docker Hub
run: |
docker login \
--username ${{ secrets.DOCKERHUB_LOGIN_DEV }} \
--password ${{ secrets.DOCKERHUB_PASSWORD_DEV }}
- name: Push joint FIPS container manifest for all platforms to Open Source ECR
run: |
make push-container-manifest-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64" \
BUILD_TYPE_SUFFIX="-fips"
- name: Push joint FIPS container manifest for all platforms to DockerHub
run: |
make push-container-manifest-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64" \
REPO_URL=sumologic/sumologic-otel-collector-dev \
BUILD_TYPE_SUFFIX="-fips"
- name: Push joint UBI-based FIPS container manifest for all platforms to Open Source ECR
run: |
make push-container-manifest-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64 linux/arm64" \
BUILD_TYPE_SUFFIX="-ubi-fips"
- name: Push joint UBI-based FIPS container manifest for all platforms to DockerHub
run: |
make push-container-manifest-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64 linux/arm64" \
REPO_URL=sumologic/sumologic-otel-collector-dev \
BUILD_TYPE_SUFFIX="-ubi-fips"
- name: Push joint container manifest for all platforms to Open Source ECR
run: |
make push-container-manifest-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64 linux/arm64 windows/amd64/ltsc2022 windows/amd64/ltsc2019"
- name: Push joint container manifest for all platforms to DockerHub
run: |
make push-container-manifest-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64 linux/arm64 windows/amd64/ltsc2022 windows/amd64/ltsc2019" \
REPO_URL=sumologic/sumologic-otel-collector-dev
- name: Push joint UBI-based container manifest for all platforms to Open Source ECR
run: |
make push-container-manifest-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64 linux/arm64" \
BUILD_TYPE_SUFFIX="-ubi"
- name: Push joint UBI-based container manifest for all platforms to DockerHub
run: |
make push-container-manifest-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64 linux/arm64" \
REPO_URL=sumologic/sumologic-otel-collector-dev \
BUILD_TYPE_SUFFIX="-ubi"
package-msi:
name: Package MSI
runs-on: windows-2019
needs:
- build
strategy:
matrix:
include:
- arch_os: windows_amd64
platform: x64
fips: false
- arch_os: windows_amd64
platform: x64
fips: true
steps:
- uses: actions/checkout@v4

- name: Fetch current branch
run: ./ci/fetch_current_branch.sh

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Fetch binary artifact for ${{ matrix.arch_os }}
uses: actions/download-artifact@v4
with:
name: otelcol-sumo${{ matrix.fips && '-fips' || '' }}-${{ matrix.arch_os }}.exe
path: ./otelcolbuilder/cmd

- name: Rename fips binary artifact for ${{ matrix.arch_os }}
if: matrix.fips
working-directory: ./otelcolbuilder/cmd
run: mv otelcol-sumo-fips-${{ matrix.arch_os }}.exe otelcol-sumo-${{ matrix.arch_os }}.exe

- name: Set OVERRIDE_BUILD_NUMBER
run: echo "OVERRIDE_BUILD_VERSION=$GITHUB_RUN_NUMBER" >> $GITHUB_ENV

- name: Set PRODUCT_VERSION
run: echo "PRODUCT_VERSION=$(./ci/get_version.sh productversion)" >> $GITHUB_ENV

- name: Build MSI for ${{ matrix.arch_os }}
working-directory: ./packaging/msi/wix
run: msbuild.exe -p:Configuration=Release -p:Platform=${{ matrix.platform }} -p:ProductVersion=$PRODUCT_VERSION -p:FIPSEnabled=${{ matrix.fips }} -Restore

- name: Store MSI as action artifact for ${{ matrix.arch_os }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arch_os }}${{ matrix.fips && '_fips' || '' }}_msi
path: ./packaging/msi/wix/bin/${{ matrix.platform }}/en-US/*.msi
if-no-files-found: error

install-script:
name: Store install script
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: SumoLogic/sumologic-otel-collector-packaging

- name: Store Linux install script as action artifact
uses: actions/upload-artifact@v4
with:
name: install.sh
path: ./install-script/install.sh
if-no-files-found: error

- name: Store Windows install script as action artifact
uses: actions/upload-artifact@v4
with:
name: install.ps1
path: ./install-script/install.ps1
if-no-files-found: error

trigger-packaging:
name: Trigger Packaging
needs:
- build
- build-otelcol-config
- lint
- package-msi
- push-docker-manifest
uses: ./.github/workflows/workflow-trigger-packaging.yml
secrets: inherit
with:
workflow_id: ${{ github.run_id }}
create_release: false

0 comments on commit 0178666

Please sign in to comment.