From 52c5a9974eaf85dc35bfc0f687bf1d0568bb4a5a Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 7 Nov 2024 15:18:27 -0500 Subject: [PATCH 1/8] ci: add workflow dispatch tag var --- .github/workflows/csharp_release.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/csharp_release.yml b/.github/workflows/csharp_release.yml index 80461161..ad920182 100644 --- a/.github/workflows/csharp_release.yml +++ b/.github/workflows/csharp_release.yml @@ -3,14 +3,19 @@ on: release: types: [ published ] # Trigger on published pre-releases and releases - workflow_dispatch: + workflow_dispatch: + inputs: + tag: + description: 'Tag name' + required: true + default: 'v4.1.0' jobs: variables: name: Set Variables runs-on: ubuntu-latest env: - TAG: ${{ github.event.release.tag_name }} + TAG: ${{ github.event.release.tag_name || github.event.inputs.tag }} steps: - name: Extract semantic version from tag id: set_version From 960faadd9bbe5a1e8d259a9eeece8ea7a414d531 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 7 Nov 2024 15:24:40 -0500 Subject: [PATCH 2/8] fix: tag ref --- .github/workflows/csharp_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/csharp_release.yml b/.github/workflows/csharp_release.yml index ad920182..b28e90c0 100644 --- a/.github/workflows/csharp_release.yml +++ b/.github/workflows/csharp_release.yml @@ -30,7 +30,7 @@ jobs: echo "Extracted semantic version: ${SEMANTIC_VERSION}" echo "semantic_version=${SEMANTIC_VERSION}" >> $GITHUB_OUTPUT outputs: - tag: $TAG + tag: ${{ env.TAG }} semanticVersion: ${{ steps.set_version.outputs.semantic_version }} buildFrameworkVersions: From 3740f264ba58392c552e9d092ce59562b0f8abfd Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 7 Nov 2024 15:34:28 -0500 Subject: [PATCH 3/8] fix: named artifacts then combine --- .github/workflows/csharp_release.yml | 41 ++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/.github/workflows/csharp_release.yml b/.github/workflows/csharp_release.yml index b28e90c0..cfe052df 100644 --- a/.github/workflows/csharp_release.yml +++ b/.github/workflows/csharp_release.yml @@ -34,7 +34,7 @@ jobs: semanticVersion: ${{ steps.set_version.outputs.semantic_version }} buildFrameworkVersions: - name: Build Framework versions + name: Build .NET Framework versions needs: [ variables ] runs-on: windows-2019 # required version for Framework 4.0 steps: @@ -53,12 +53,12 @@ jobs: - name: Upload Framework artifacts uses: actions/upload-artifact@v4 with: - name: unsigned-dlls + name: unsigned-dlls-framework if-no-files-found: error path: ./**/bin/Release/**/Optimizely*.dll buildStandard16: - name: Build Standard 1.6 version + name: Build .NET 1.6 version needs: [ variables ] runs-on: windows-latest steps: @@ -75,12 +75,12 @@ jobs: - name: Upload Standard 1.6 artifact uses: actions/upload-artifact@v4 with: - name: unsigned-dlls + name: unsigned-dlls-standard16 if-no-files-found: error path: ./**/bin/Release/**/Optimizely*.dll buildStandard20: - name: Build Standard 2.0 version + name: Build .NET 2.0 version needs: [ variables ] runs-on: windows-latest steps: @@ -97,9 +97,38 @@ jobs: - name: Build and strongly name assemblies uses: actions/upload-artifact@v4 with: - name: unsigned-dlls + name: unsigned-dlls-standard20 if-no-files-found: error path: ./**/bin/Release/**/Optimizely*.dll + + combineArtifacts: + name: Combine artifacts + needs: [ variables, buildFrameworkVersions, buildStandard16, buildStandard20 ] + runs-on: ubuntu-latest + steps: + - name: Download Framework artifacts + uses: actions/download-artifact@v4 + with: + name: unsigned-dlls-framework + - name: Download Standard 1.6 artifacts + uses: actions/download-artifact@v4 + with: + name: unsigned-dlls-standard16 + - name: Download Standard 2.0 artifacts + uses: actions/download-artifact@v4 + with: + name: unsigned-dlls-standard20 + - name: Combine artifacts + run: | + mkdir -p ./unsigned-dlls + mv ./unsigned-dlls-framework/**/Optimizely*.dll ./unsigned-dlls/ + mv ./unsigned-dlls-standard16/**/Optimizely*.dll ./unsigned-dlls/ + mv ./unsigned-dlls-standard20/**/Optimizely*.dll ./unsigned-dlls/ + - name: Upload combined artifacts + uses: actions/upload-artifact@v4 + with: + name: unsigned-dlls + if-no-files-found: error sign: name: Send DLLs for signing From bd1c96ed939e4cdb4dc8bae29fc0732a5db9650c Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 7 Nov 2024 15:36:28 -0500 Subject: [PATCH 4/8] fix: dependency/`needs` declarations --- .github/workflows/csharp_release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/csharp_release.yml b/.github/workflows/csharp_release.yml index cfe052df..ceb7b1af 100644 --- a/.github/workflows/csharp_release.yml +++ b/.github/workflows/csharp_release.yml @@ -132,7 +132,7 @@ jobs: sign: name: Send DLLs for signing - needs: [ variables, buildFrameworkVersions, buildStandard16, buildStandard20 ] + needs: [ combineArtifacts ] runs-on: ubuntu-latest env: # TODO: Replace actual values @@ -180,7 +180,7 @@ jobs: pack: name: Pack NuGet package - needs: [ variables, sign ] + needs: [ sign ] runs-on: ubuntu-latest env: VERSION: ${{ needs.variables.outputs.semanticVersion }} @@ -233,7 +233,7 @@ jobs: publish: name: Publish package to NuGet after reviewing the artifact - needs: [ variables, pack ] + needs: [ pack ] runs-on: ubuntu-latest # Review the `nuget-package` artifact ensuring the dlls are # organized and signed before approving. From 9f9051f5e5ff8f237f202bce5ff29f2be720e911 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 7 Nov 2024 15:42:09 -0500 Subject: [PATCH 5/8] fix: missing destination paths for downloads --- .github/workflows/csharp_release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/csharp_release.yml b/.github/workflows/csharp_release.yml index ceb7b1af..4a36202b 100644 --- a/.github/workflows/csharp_release.yml +++ b/.github/workflows/csharp_release.yml @@ -110,14 +110,17 @@ jobs: uses: actions/download-artifact@v4 with: name: unsigned-dlls-framework + path: ./unsigned-dlls-framework - name: Download Standard 1.6 artifacts uses: actions/download-artifact@v4 with: name: unsigned-dlls-standard16 + path: ./unsigned-dlls-standard16 - name: Download Standard 2.0 artifacts uses: actions/download-artifact@v4 with: name: unsigned-dlls-standard20 + path: ./unsigned-dlls-standard20 - name: Combine artifacts run: | mkdir -p ./unsigned-dlls @@ -129,6 +132,7 @@ jobs: with: name: unsigned-dlls if-no-files-found: error + path: ./unsigned-dlls sign: name: Send DLLs for signing From 89ad96f8828cda351562545fa980f44cc3816e14 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 7 Nov 2024 15:51:56 -0500 Subject: [PATCH 6/8] ci: filter off OptimizelySDK.Tests dlls + `ls` on combineArtifacts --- .github/workflows/csharp_release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/csharp_release.yml b/.github/workflows/csharp_release.yml index 4a36202b..a270dfbc 100644 --- a/.github/workflows/csharp_release.yml +++ b/.github/workflows/csharp_release.yml @@ -55,7 +55,8 @@ jobs: with: name: unsigned-dlls-framework if-no-files-found: error - path: ./**/bin/Release/**/Optimizely*.dll + path: | + $(find . -path './**/bin/Release/**/Optimizely*.dll' ! -path './**/OptimizelySDK.Tests/**') buildStandard16: name: Build .NET 1.6 version @@ -121,6 +122,8 @@ jobs: with: name: unsigned-dlls-standard20 path: ./unsigned-dlls-standard20 + - name: List all downloaded artifacts + run: ls -R ./ - name: Combine artifacts run: | mkdir -p ./unsigned-dlls From 40871e87f99e630a605d016bb87a324ead0dce1e Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 7 Nov 2024 16:02:13 -0500 Subject: [PATCH 7/8] ci: filter off OptimizelySDK.Test when combining --- .github/workflows/csharp_release.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/csharp_release.yml b/.github/workflows/csharp_release.yml index a270dfbc..d273c533 100644 --- a/.github/workflows/csharp_release.yml +++ b/.github/workflows/csharp_release.yml @@ -55,8 +55,7 @@ jobs: with: name: unsigned-dlls-framework if-no-files-found: error - path: | - $(find . -path './**/bin/Release/**/Optimizely*.dll' ! -path './**/OptimizelySDK.Tests/**') + path: ./**/bin/Release/**/Optimizely*.dll buildStandard16: name: Build .NET 1.6 version @@ -127,9 +126,9 @@ jobs: - name: Combine artifacts run: | mkdir -p ./unsigned-dlls - mv ./unsigned-dlls-framework/**/Optimizely*.dll ./unsigned-dlls/ - mv ./unsigned-dlls-standard16/**/Optimizely*.dll ./unsigned-dlls/ - mv ./unsigned-dlls-standard20/**/Optimizely*.dll ./unsigned-dlls/ + find ./unsigned-dlls-framework -type f -name 'Optimizely*.dll' ! -path '*/OptimizelySDK.Tests/*' -exec mv {} ./unsigned-dlls/ \; + mv ./unsigned-dlls-standard16/**/Optimizely*.dll ./unsigned-dlls/ \; + mv ./unsigned-dlls-standard20/**/Optimizely*.dll ./unsigned-dlls/ \; - name: Upload combined artifacts uses: actions/upload-artifact@v4 with: From 285bf560e17a29faccd71e2d1c465d0aa0eb46ec Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 7 Nov 2024 16:08:18 -0500 Subject: [PATCH 8/8] fix: find vs mv --- .github/workflows/csharp_release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/csharp_release.yml b/.github/workflows/csharp_release.yml index d273c533..39fad87b 100644 --- a/.github/workflows/csharp_release.yml +++ b/.github/workflows/csharp_release.yml @@ -127,8 +127,8 @@ jobs: run: | mkdir -p ./unsigned-dlls find ./unsigned-dlls-framework -type f -name 'Optimizely*.dll' ! -path '*/OptimizelySDK.Tests/*' -exec mv {} ./unsigned-dlls/ \; - mv ./unsigned-dlls-standard16/**/Optimizely*.dll ./unsigned-dlls/ \; - mv ./unsigned-dlls-standard20/**/Optimizely*.dll ./unsigned-dlls/ \; + find ./unsigned-dlls-standard16 -type f -name 'Optimizely*.dll' -exec mv {} ./unsigned-dlls/ \; + find ./unsigned-dlls-standard20 -type f -name 'Optimizely*.dll' -exec mv {} ./unsigned-dlls/ \; - name: Upload combined artifacts uses: actions/upload-artifact@v4 with: