-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
49 additions
and
40 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,23 @@ env: | |
|
||
jobs: | ||
|
||
get-version: | ||
name: Get application version for this revision | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.get-version.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Get version | ||
id: get-version | ||
run: | | ||
TAG=$(git describe --tags --abbrev=5 --match "v[0-9]*") | ||
echo "version=${TAG/v}" > $GITHUB_OUTPUT | ||
- name: Print version | ||
run: echo ::notice title=Version::${{ steps.get-version.outputs.version }} | ||
|
||
# Add lint to dev builds as that's the only way for cache to be shared across branches. | ||
# https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows#matching-a-cache-key | ||
lint: | ||
|
@@ -87,6 +104,7 @@ jobs: | |
build: | ||
name: Build | ||
uses: ./.github/workflows/workflow-build.yml | ||
needs: [get-version] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -115,6 +133,7 @@ jobs: | |
runs-on: ${{ matrix.runs-on }} | ||
fips: ${{ matrix.fips == true }} | ||
save-cache: true | ||
sumo_component_gomod_version: "v${{ needs.get-version.outputs.version }}" | ||
secrets: | ||
apple_developer_certificate_p12_base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} | ||
apple_developer_certificate_password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} | ||
|
@@ -130,19 +149,13 @@ jobs: | |
runs-on: ubuntu-20.04 | ||
needs: | ||
- build | ||
- get-version | ||
strategy: | ||
matrix: | ||
arch_os: [ 'linux_amd64', 'linux_arm64' ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Extract tag | ||
id: extract_tag | ||
run: echo "tag=$(git rev-parse HEAD)" > $GITHUB_OUTPUT | ||
|
||
- name: Print tag | ||
run: echo "Running dev build for ${{ steps.extract_tag.outputs.tag }}" | ||
|
||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
|
||
|
@@ -174,15 +187,15 @@ jobs: | |
run: | | ||
cp otelcol-sumo-fips-${{ matrix.arch_os }} otelcol-sumo | ||
make build-push-container-multiplatform-dev \ | ||
BUILD_TAG=${{ steps.extract_tag.outputs.tag }} \ | ||
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=${{ steps.extract_tag.outputs.tag }} \ | ||
BUILD_TAG=${{ needs.get-version.outputs.version }} \ | ||
PLATFORM=${{ matrix.arch_os }} \ | ||
REPO_URL=sumologic/sumologic-otel-collector-dev \ | ||
BUILD_TYPE_SUFFIX="-fips" | ||
|
@@ -191,15 +204,15 @@ jobs: | |
run: | | ||
cp otelcol-sumo-fips-${{ matrix.arch_os }} otelcol-sumo | ||
make build-push-container-ubi-dev \ | ||
BUILD_TAG=${{ steps.extract_tag.outputs.tag }} \ | ||
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=${{ steps.extract_tag.outputs.tag }} \ | ||
BUILD_TAG=${{ needs.get-version.outputs.version }} \ | ||
PLATFORM=${{ matrix.arch_os }} \ | ||
REPO_URL=sumologic/sumologic-otel-collector-dev \ | ||
BUILD_TYPE_SUFFIX="-ubi-fips" | ||
|
@@ -213,30 +226,30 @@ jobs: | |
run: | | ||
cp otelcol-sumo-${{ matrix.arch_os }} otelcol-sumo | ||
make build-push-container-multiplatform-dev \ | ||
BUILD_TAG=${{ steps.extract_tag.outputs.tag }} \ | ||
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=${{ steps.extract_tag.outputs.tag }} \ | ||
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=${{ steps.extract_tag.outputs.tag }} \ | ||
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=${{ steps.extract_tag.outputs.tag }} \ | ||
BUILD_TAG=${{ needs.get-version.outputs.version }} \ | ||
PLATFORM=${{ matrix.arch_os }} \ | ||
REPO_URL=sumologic/sumologic-otel-collector-dev \ | ||
BUILD_TYPE_SUFFIX="-ubi" | ||
|
@@ -246,6 +259,7 @@ jobs: | |
runs-on: ${{ matrix.runs-on }} | ||
needs: | ||
- build | ||
- get-version | ||
strategy: | ||
matrix: | ||
include: | ||
|
@@ -258,13 +272,6 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Extract tag | ||
id: extract_tag | ||
run: echo "tag=$(git rev-parse HEAD)" > $GITHUB_OUTPUT | ||
|
||
- name: Print tag | ||
run: echo "Running dev build for ${{ steps.extract_tag.outputs.tag }}" | ||
|
||
- name: Login to Open Source ECR | ||
run: | | ||
USERNAME=$(powershell.exe "echo \$Env:UserName") | ||
|
@@ -292,14 +299,14 @@ jobs: | |
run: | | ||
cp artifacts/otelcol-sumo-${{matrix.arch_os}}.exe otelcol-sumo.exe | ||
make build-push-container-windows-dev \ | ||
BUILD_TAG=${{ steps.extract_tag.outputs.tag }} \ | ||
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=${{ steps.extract_tag.outputs.tag }} \ | ||
BUILD_TAG=${{ needs.get-version.outputs.version }} \ | ||
REPO_URL=sumologic/sumologic-otel-collector-dev \ | ||
PLATFORM=${{ matrix.arch_os }}_${{ matrix.base_image_tag }} | ||
|
@@ -309,16 +316,10 @@ jobs: | |
needs: | ||
- build-container-images | ||
- build-windows-container-images | ||
- get-version | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Extract tag | ||
id: extract_tag | ||
run: echo "tag=$(git rev-parse HEAD)" > $GITHUB_OUTPUT | ||
|
||
- name: Print tag | ||
run: echo "Running dev build for ${{ steps.extract_tag.outputs.tag }}" | ||
|
||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
|
||
|
@@ -344,57 +345,57 @@ jobs: | |
- name: Push joint FIPS container manifest for all platforms to Open Source ECR | ||
run: | | ||
make push-container-manifest-dev \ | ||
BUILD_TAG=${{ steps.extract_tag.outputs.tag }} \ | ||
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=${{ steps.extract_tag.outputs.tag }} \ | ||
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=${{ steps.extract_tag.outputs.tag }} \ | ||
BUILD_TAG=${{ needs.get-version.outputs.version }} \ | ||
PLATFORMS="linux/amd64" \ | ||
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=${{ steps.extract_tag.outputs.tag }} \ | ||
BUILD_TAG=${{ needs.get-version.outputs.version }} \ | ||
PLATFORMS="linux/amd64" \ | ||
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=${{ steps.extract_tag.outputs.tag }} \ | ||
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=${{ steps.extract_tag.outputs.tag }} \ | ||
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=${{ steps.extract_tag.outputs.tag }} \ | ||
BUILD_TAG=${{ needs.get-version.outputs.version }} \ | ||
PLATFORMS="linux/amd64" \ | ||
BUILD_TYPE_SUFFIX="-ubi" | ||
- name: Push joint UBI-based container manifest for all platforms to DockerHub | ||
run: | | ||
make push-container-manifest-dev \ | ||
BUILD_TAG=${{ steps.extract_tag.outputs.tag }} \ | ||
BUILD_TAG=${{ needs.get-version.outputs.version }} \ | ||
PLATFORMS="linux/amd64" \ | ||
REPO_URL=sumologic/sumologic-otel-collector-dev \ | ||
BUILD_TYPE_SUFFIX="-ubi" | ||
|
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