Skip to content

Commit

Permalink
Merge branch 'main' into remove-url-rewrite-hack
Browse files Browse the repository at this point in the history
  • Loading branch information
echlebek authored Nov 8, 2024
2 parents b95e693 + 1b49351 commit 1e129fb
Show file tree
Hide file tree
Showing 58 changed files with 659 additions and 2,750 deletions.
1 change: 1 addition & 0 deletions .changelog/1693.changed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chore(ci): remove MSIs from this repo
32 changes: 32 additions & 0 deletions .github/workflows/_get-version-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Get next available version

on:
workflow_call:
outputs:
version:
description: "The next unused version to use"
value: ${{ jobs.get-version.outputs.version }}

defaults:
run:
shell: bash

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: |
version=$(./ci/get_version.sh full | xargs)-$(git rev-parse HEAD | xargs)
echo "version=${version}" > $GITHUB_OUTPUT
- name: Print version
run: echo ::notice title=Version::${{ steps.get-version.outputs.version }}
94 changes: 14 additions & 80 deletions .github/workflows/dev_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,10 @@ env:
GO_VERSION: "1.22.6"

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:
name: Lint (golangci-lint)
name: Lint (staticcheck)
runs-on: ubuntu-20.04
strategy:
matrix:
Expand Down Expand Up @@ -65,18 +48,18 @@ jobs:
- uses: actions/cache@v4
with:
path: |
/home/runner/.cache/golangci-lint
key: golangci-lint-${{ env.GO_VERSION }}-${{matrix.arch_os}}-${{ hashFiles('pkg/**/go.sum', 'otelcolbuilder/.otelcol-builder.yaml') }}
/home/runner/.cache/staticcheck
key: staticcheck-${{ env.GO_VERSION }}-${{matrix.arch_os}}-${{ hashFiles('pkg/**/go.sum', 'otelcolbuilder/.otelcol-builder.yaml') }}
restore-keys: |
golangci-lint-${{ env.GO_VERSION }}-${{matrix.arch_os}}-
staticcheck-${{ env.GO_VERSION }}-${{matrix.arch_os}}-
- name: Install golangci-lint
run: make install-golangci-lint
- name: Install staticcheck
run: make install-staticcheck

- name: Add opentelemetry-collector-builder installation dir to PATH
run: echo "$HOME/bin" >> $GITHUB_PATH

- name: Run golangci-lint
- name: Run staticcheck
run: make golint

test:
Expand Down Expand Up @@ -119,6 +102,10 @@ jobs:
save-cache: true
boringcrypto: ${{ matrix.boringcrypto == true }}

get-version:
name: Get next available version
uses: ./.github/workflows/_get-version-workflow.yml

build:
name: Build
uses: ./.github/workflows/workflow-build.yml
Expand Down Expand Up @@ -151,7 +138,7 @@ jobs:
runs-on: ${{ matrix.runs-on }}
fips: ${{ matrix.fips == true }}
save-cache: true
sumo_component_gomod_version: "v${{ needs.get-version.outputs.version }}"
version: ${{ 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 }}
Expand Down Expand Up @@ -212,7 +199,7 @@ jobs:

- name: Set up Buildx
id: buildx
uses: docker/setup-buildx-action@v3.6.1
uses: docker/setup-buildx-action@v3.7.1

- name: Show Buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}
Expand Down Expand Up @@ -376,7 +363,7 @@ jobs:

- name: Set up Buildx
id: buildx
uses: docker/setup-buildx-action@v3.6.1
uses: docker/setup-buildx-action@v3.7.1

- name: Show Buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}
Expand Down Expand Up @@ -451,57 +438,6 @@ jobs:
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
Expand Down Expand Up @@ -530,10 +466,8 @@ jobs:
- 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
48 changes: 15 additions & 33 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,32 +175,8 @@ jobs:
save-cache: true
boringcrypto: ${{ matrix.boringcrypto == true }}

test-wixext:
name: Test (SumoLogic.wixext)
runs-on: windows-2019
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: Restore NuGet packages
working-directory: ./packaging/msi/SumoLogic.wixext/SumoLogicTests
run: nuget.exe restore -PackagesDirectory ../packages

- name: Build unit tests
working-directory: ./packaging/msi/SumoLogic.wixext/SumoLogicTests
run: msbuild.exe -p:Configuration=Release -p:Platform=AnyCPU -Restore

- name: Run unit tests
working-directory: ./packaging/msi/SumoLogic.wixext/SumoLogicTests/bin/Release
run: dotnet test -v:n ./SumoLogicTests.dll

lint:
name: Lint (golangci-lint)
name: Lint (staticcheck)
runs-on: ubuntu-20.04
needs: [ build-changed ]
if: needs.build-changed.outputs.any_changed == 'true'
Expand Down Expand Up @@ -233,23 +209,28 @@ jobs:
- uses: actions/cache/restore@v4
with:
path: |
/home/runner/.cache/golangci-lint
key: golangci-lint-${{ env.GO_VERSION }}-${{matrix.arch_os}}-${{ hashFiles('pkg/**/go.sum', 'otelcolbuilder/.otelcol-builder.yaml') }}
/home/runner/.cache/staticcheck
key: staticcheck-${{ env.GO_VERSION }}-${{matrix.arch_os}}-${{ hashFiles('pkg/**/go.sum', 'otelcolbuilder/.otelcol-builder.yaml') }}
restore-keys: |
golangci-lint-${{ env.GO_VERSION }}-${{matrix.arch_os}}-
staticcheck-${{ env.GO_VERSION }}-${{matrix.arch_os}}-
- name: Install golangci-lint
run: make install-golangci-lint
- name: Install staticcheck
run: make install-staticcheck

- name: Add opentelemetry-collector-builder installation dir to PATH
run: echo "$HOME/bin" >> $GITHUB_PATH

- name: Run golangci-lint
- name: Run staticcheck
run: make golint

get-version:
name: Get next available version
uses: ./.github/workflows/_get-version-workflow.yml

build:
name: Build
uses: ./.github/workflows/workflow-build.yml
needs: [get-version]
strategy:
matrix:
include:
Expand All @@ -273,6 +254,7 @@ jobs:
arch_os: ${{ matrix.arch_os }}
runs-on: ${{ matrix.runs-on }}
fips: ${{ matrix.fips == true }}
version: ${{ 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 }}
Expand Down Expand Up @@ -332,7 +314,7 @@ jobs:

- name: Set up Buildx
id: buildx
uses: docker/setup-buildx-action@v3.6.1
uses: docker/setup-buildx-action@v3.7.1

- name: Show Buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}
Expand Down Expand Up @@ -404,4 +386,4 @@ jobs:
- name: Test built image
run: make test-built-image

# ToDo: build windows FIPS image
# TODO: build windows FIPS image
13 changes: 0 additions & 13 deletions .github/workflows/release-packaging.yml

This file was deleted.

Loading

0 comments on commit 1e129fb

Please sign in to comment.