Skip to content

Commit

Permalink
Merge pull request #58 from SumoLogic/feat/msi-fips
Browse files Browse the repository at this point in the history
Add fips support to msi package
  • Loading branch information
swiatekm authored Apr 4, 2024
2 parents 4c26139 + 1509402 commit 34cb412
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 21 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/_reusable_build_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ on:
build_tool:
required: true
type: string
fips:
required: false
type: boolean
default: false
secrets:
gh_artifacts_token:
required: true
Expand Down Expand Up @@ -191,7 +195,7 @@ jobs:

build_wix_package:
runs-on: ${{ inputs.runs_on }}
name: Build (WiX)
name: Build (WiX) ${{ inputs.fips && 'FIPS' || '' }}
if: inputs.build_tool == 'wix'
outputs:
package_path: ${{ steps.package.outputs.path }}
Expand All @@ -217,6 +221,12 @@ jobs:
if: inputs.workflow_id != ''
run: echo "OTC_ARTIFACTS_SOURCE=github-artifacts" >> $GITHUB_ENV

- name: Determine artifact names
run: |
echo "OTC_WORKFLOW_ARTIFACT_NAME=otelcol-sumo-${{ inputs.fips && 'fips-' || '' }}windows_${{ inputs.goarch }}.exe" >> $GITHUB_ENV
echo "OTC_RELEASE_ARTIFACT_NAME=otelcol-sumo-${{ inputs.otc_version }}-sumo-${{inputs.otc_sumo_version }}-${{ inputs.fips && 'fips-' || '' }}windows_${{ inputs.goarch }}.exe" >> $GITHUB_ENV
echo "OTC_BUILD_INPUT_NAME=otelcol-sumo-windows_${{ inputs.goarch }}.exe" >> $GITHUB_ENV
# Download the artifacts required to build the package target. If
# inputs.workflow_id is empty then this will be skipped and an attempt
# will be made to fetch the artifacts from a GitHub Release matching
Expand All @@ -230,7 +240,7 @@ jobs:
run_id: ${{ inputs.workflow_id }}
workflow: dev_builds.yml
workflow_conclusion: success
name: otelcol-sumo-windows_${{ inputs.goarch }}.exe
name: ${{ env.OTC_ARTIFACT_NAME }}
path: ./build/artifacts
if_no_artifact_found: fail

Expand All @@ -242,19 +252,23 @@ jobs:
with:
repository: SumoLogic/sumologic-otel-collector
tag: v${{ inputs.otc_version }}-sumo-${{ inputs.otc_sumo_version }}
fileName: >-
otelcol-sumo-${{ inputs.otc_version }}-sumo-${{
inputs.otc_sumo_version }}-windows_${{ inputs.goarch }}.exe
fileName: ${{ env.OTC_RELEASE_ARTIFACT_NAME }}
out-file-path: build/artifacts

- name: Rename GitHub Release artifact
if: inputs.workflow_id == ''
working-directory: ./build/artifacts
env:
MV_FROM: >-
otelcol-sumo-${{ inputs.otc_version }}-sumo-${{
inputs.otc_sumo_version }}-windows_${{ inputs.goarch }}.exe
MV_TO: otelcol-sumo-windows_${{ inputs.goarch }}.exe
MV_FROM: ${{ env.OTC_RELEASE_ARTIFACT_NAME }}
MV_TO: ${{ env.OTC_BUILD_INPUT_NAME }}
run: mv "$MV_FROM" "$MV_TO"

- name: Rename GitHub Workflow artifact
if: inputs.workflow_id != ''
working-directory: ./build/artifacts
env:
MV_FROM: ${{ env.OTC_WORKFLOW_ARTIFACT_NAME }}
MV_TO: ${{ env.OTC_BUILD_INPUT_NAME }}
run: mv "$MV_FROM" "$MV_TO"

- name: Build MSI
Expand All @@ -267,12 +281,13 @@ jobs:
msbuild.exe -p:Configuration=Release
-p:Platform=$PLATFORM
-p:ProductVersion=$PRODUCT_VERSION
-p:FIPSEnabled=${{ inputs.fips }}
-Restore
- name: Store MSI as action artifact
uses: actions/upload-artifact@v4
with:
name: windows_${{ inputs.goarch }}_msi
name: windows_${{ inputs.fips && 'fips_' || '' }}${{ inputs.goarch }}_msi
path: ./msi/wix/bin/${{ inputs.package_arch }}/en-US/*.msi
if-no-files-found: error

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/build_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ jobs:
goarch: ${{ matrix.goarch }}
package_arch: ${{ matrix.package_arch }}
build_tool: ${{ matrix.build_tool }}
fips: ${{ matrix.fips || false }}
secrets:
apple_developer_certificate_p12_base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
apple_developer_certificate_password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
Expand Down Expand Up @@ -164,6 +165,12 @@ jobs:
goarch: amd64
package_arch: x64
build_tool: wix
- target: otc_fips_windows_amd64_wix
runs_on: windows-2019
goarch: amd64
package_arch: x64
build_tool: wix
fips: true

install-script:
name: Store install script
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ processors:
## Configuration for Sumo Logic Schema Processor
## The Sumo Logic Schema processor modifies the metadata on logs, metrics and traces sent to Sumo Logic
## so that the Sumo Logic apps can make full use of the ingested data.
## ref: https://github.com/SumoLogic/sumologic-otel-collector/tree/main/pkg/processor/sumologicschemaprocessor
sumologic_schema:
## ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/sumologicprocessor
sumologic:

service:
extensions:
Expand All @@ -82,7 +82,7 @@ service:
processors:
- memory_limiter
- batch
- sumologic_schema
- sumologic
exporters:
- sumologic
logs/default:
Expand All @@ -91,7 +91,7 @@ service:
processors:
- memory_limiter
- batch
- sumologic_schema
- sumologic
exporters:
- sumologic
traces/default:
Expand All @@ -100,6 +100,6 @@ service:
processors:
- memory_limiter
- batch
- sumologic_schema
- sumologic
exporters:
- sumologic
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ processors:
## Configuration for Sumo Logic Schema Processor
## The Sumo Logic Schema processor modifies the metadata on logs, metrics and traces sent to Sumo Logic
## so that the Sumo Logic apps can make full use of the ingested data.
## ref: https://github.com/SumoLogic/sumologic-otel-collector/tree/main/pkg/processor/sumologicschemaprocessor
sumologic_schema:
## ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/sumologicprocessor
sumologic:

service:
extensions:
Expand All @@ -63,7 +63,7 @@ service:
processors:
- memory_limiter
- batch
- sumologic_schema
- sumologic
exporters:
- sumologic
logs/default:
Expand All @@ -72,7 +72,7 @@ service:
processors:
- memory_limiter
- batch
- sumologic_schema
- sumologic
exporters:
- sumologic
traces/default:
Expand All @@ -81,6 +81,6 @@ service:
processors:
- memory_limiter
- batch
- sumologic_schema
- sumologic
exporters:
- sumologic
3 changes: 3 additions & 0 deletions msi/wix/assets/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
extensions:
sumologic:
installation_token:
10 changes: 9 additions & 1 deletion msi/wix/otelcol-sumo.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,26 @@
<Cultures>en-US</Cultures>
<DebugType>none</DebugType>
<RepoRoot>$([System.IO.Path]::GetFullPath('..\..'))</RepoRoot>
<FIPSEnabled>false</FIPSEnabled>
</PropertyGroup>

<PropertyGroup>
<SuppressIces>ICE61</SuppressIces>
</PropertyGroup>

<PropertyGroup>
<OutputName>otelcol-sumo_$(ProductVersion)_en-US.$(Platform)</OutputName>
<OutputPath>bin\$(Platform)\</OutputPath>
<IntermediateOutputPath>obj\$(Platform)\</IntermediateOutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(FIPSEnabled)' == 'false'">
<OutputName>otelcol-sumo_$(ProductVersion)_en-US.$(Platform)</OutputName>
</PropertyGroup>

<PropertyGroup Condition="'$(FIPSEnabled)' == 'true'">
<OutputName>otelcol-sumo_$(ProductVersion)_en-US.$(Platform)-fips</OutputName>
</PropertyGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);ProductVersion=$(ProductVersion)</DefineConstants>
<DefineConstants>$(DefineConstants);UpgradeCode=$(UpgradeCode)</DefineConstants>
Expand Down

0 comments on commit 34cb412

Please sign in to comment.