From ebf4698f5e6429aca98a6381f99394625e0e5d78 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 7 Aug 2023 16:02:02 -0700 Subject: [PATCH 01/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 838813fb..6cdf0a2f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -7,6 +7,11 @@ on: branches: [ "main" ] pull_request: branches: [ "*" ] + release: + #workflow_call: + # Use "Inputs" and "Secrets" to pass values from caller if needed + # You can then use the ${{ inputs.variable-name }} and ${{ secrets.envPAT }} syntax to access them + # See https://docs.github.com/en/actions/using-workflows/reusing-workflows for more info jobs: build: @@ -14,7 +19,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, ubuntu-latest, macOS-latest] # macOS-latest and ubuntu-latest are broken at the moment. Add it back in when fixed. + os: [windows-latest, ubuntu-latest, macOS-latest] steps: - uses: actions/checkout@v3 @@ -44,23 +49,31 @@ jobs: # Eventually we might want to tweak the CodeQL job to run on what we already built above so it isn't using resources to autobuild. - name: Publish debug - #if: ${{ github.event_name == 'push' }} + #if: ${{ github.event_name != 'pull_request' }} # Publish all of the non-test projects to published/release. We have to use the solution file to get the right output paths. run: dotnet publish --no-build --configuration Debug --output published/debug CoseSignTool/CoseSignTool.sln - name: Publish release - #if: ${{ github.event_name == 'push' }} + #if: ${{ github.event_name != 'pull_request' }} # Publish CoseSignTool.exe and it's dependencies (all of the non-test projects) to published/release. run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool/CoseSignTool.csproj - name: List published directory Windows - if: ${{ github.event_name == 'push' && runner.os == 'Windows' }} + if: ${{ github.event_name != 'pull_request' && runner.os == 'Windows' }} run: dir /b /a /s shell: cmd working-directory: ./published - name: List published directory non-Windows - if: ${{ github.event_name == 'push' && runner.os != 'Windows' }} + if: ${{ github.event_name != 'pull_request' && runner.os != 'Windows' }} run: ls -a -R shell: bash working-directory: ./published + + - name: Upload the artifacts + #if: ${{ github.event_name == 'release' }} + uses: skx/github-action-publish-binaries@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: 'example-*' From 36f01592d07ae6ede6f611695cf306e0c5ceaacd Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 11:47:51 -0700 Subject: [PATCH 02/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 6cdf0a2f..8219e035 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -49,23 +49,25 @@ jobs: # Eventually we might want to tweak the CodeQL job to run on what we already built above so it isn't using resources to autobuild. - name: Publish debug - #if: ${{ github.event_name != 'pull_request' }} + if: ${{ github.event_name != 'pull_request' }} # Publish all of the non-test projects to published/release. We have to use the solution file to get the right output paths. run: dotnet publish --no-build --configuration Debug --output published/debug CoseSignTool/CoseSignTool.sln - name: Publish release - #if: ${{ github.event_name != 'pull_request' }} + if: ${{ github.event_name != 'pull_request' }} # Publish CoseSignTool.exe and it's dependencies (all of the non-test projects) to published/release. - run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool/CoseSignTool.csproj - + # run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool/CoseSignTool.csproj + # run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool.sln + run: dotnet publish --configuration Release --output published/Release CoseSignTool/CoseSignTool.sln + - name: List published directory Windows - if: ${{ github.event_name != 'pull_request' && runner.os == 'Windows' }} + if: ${{ github.event_name != 'pull_request' }} && runner.os == 'Windows' run: dir /b /a /s shell: cmd working-directory: ./published - name: List published directory non-Windows - if: ${{ github.event_name != 'pull_request' && runner.os != 'Windows' }} + if: ${{ github.event_name != 'pull_request' }} && runner.os != 'Windows' run: ls -a -R shell: bash working-directory: ./published @@ -76,4 +78,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - args: 'example-*' + args: '/home/runner/work/CoseSignTool/CoseSignTool/published/*' From 2fe0817062ea4c5b7b82071e1fb4eb1d9225303e Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 11:54:32 -0700 Subject: [PATCH 03/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 8219e035..91ac6d29 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -61,13 +61,13 @@ jobs: run: dotnet publish --configuration Release --output published/Release CoseSignTool/CoseSignTool.sln - name: List published directory Windows - if: ${{ github.event_name != 'pull_request' }} && runner.os == 'Windows' + if: ${{ (runner.os == 'Windows') && (github.event_name != 'pull_request') }} run: dir /b /a /s shell: cmd working-directory: ./published - name: List published directory non-Windows - if: ${{ github.event_name != 'pull_request' }} && runner.os != 'Windows' + if: ${{ (runner.os != 'Windows') && (github.event_name != 'pull_request') }} run: ls -a -R shell: bash working-directory: ./published From 202f3bc8624c737a01d86bba47089bdc7adaa64b Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 11:58:09 -0700 Subject: [PATCH 04/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 91ac6d29..9ee41cae 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -49,12 +49,12 @@ jobs: # Eventually we might want to tweak the CodeQL job to run on what we already built above so it isn't using resources to autobuild. - name: Publish debug - if: ${{ github.event_name != 'pull_request' }} + #if: ${{ github.event_name != 'pull_request' }} # Publish all of the non-test projects to published/release. We have to use the solution file to get the right output paths. run: dotnet publish --no-build --configuration Debug --output published/debug CoseSignTool/CoseSignTool.sln - name: Publish release - if: ${{ github.event_name != 'pull_request' }} + #if: ${{ github.event_name != 'pull_request' }} # Publish CoseSignTool.exe and it's dependencies (all of the non-test projects) to published/release. # run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool/CoseSignTool.csproj # run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool.sln From c4be70c0b818120ae55f5dbe445b6ee6504069cf Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 12:34:00 -0700 Subject: [PATCH 05/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 9ee41cae..b1a153dd 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -53,29 +53,39 @@ jobs: # Publish all of the non-test projects to published/release. We have to use the solution file to get the right output paths. run: dotnet publish --no-build --configuration Debug --output published/debug CoseSignTool/CoseSignTool.sln - - name: Publish release + - name: Publish release # I might have to break it into steps to get the same output paths as debug #if: ${{ github.event_name != 'pull_request' }} # Publish CoseSignTool.exe and it's dependencies (all of the non-test projects) to published/release. - # run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool/CoseSignTool.csproj + run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool/CoseSignTool.csproj # run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool.sln - run: dotnet publish --configuration Release --output published/Release CoseSignTool/CoseSignTool.sln - name: List published directory Windows - if: ${{ (runner.os == 'Windows') && (github.event_name != 'pull_request') }} + # if: ${{ (runner.os == 'Windows') && (github.event_name != 'pull_request') }} + if: ${{ (runner.os == 'Windows') }} run: dir /b /a /s shell: cmd working-directory: ./published - name: List published directory non-Windows - if: ${{ (runner.os != 'Windows') && (github.event_name != 'pull_request') }} + # if: ${{ (runner.os != 'Windows') && (github.event_name != 'pull_request') }} + if: ${{ (runner.os != 'Windows') }} run: ls -a -R shell: bash working-directory: ./published - - name: Upload the artifacts + - name: Upload debug artifacts + if: ${{ github.event_name == 'release' }} + uses: skx/github-action-publish-binaries@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: '/home/runner/work/CoseSignTool/CoseSignTool/published/debug/*' + + - name: Upload release artifacts + if: runner.os == 'Ubuntu' #if: ${{ github.event_name == 'release' }} uses: skx/github-action-publish-binaries@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - args: '/home/runner/work/CoseSignTool/CoseSignTool/published/*' + args: '/Users/runner/work/CoseSignTool/CoseSignTool/CoseSignTool/*/bin*/Release/*' From 82b2fe5c6acec475d15abf6cf0604de885c4e5d5 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 12:51:07 -0700 Subject: [PATCH 06/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b1a153dd..bf7b6cec 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -82,7 +82,7 @@ jobs: args: '/home/runner/work/CoseSignTool/CoseSignTool/published/debug/*' - name: Upload release artifacts - if: runner.os == 'Ubuntu' + if: runner.os == 'Linux' #if: ${{ github.event_name == 'release' }} uses: skx/github-action-publish-binaries@master env: From d978982e5e563a21cb4c3eba1411f31c2e7f7295 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 13:04:53 -0700 Subject: [PATCH 07/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index bf7b6cec..e12abf17 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -56,8 +56,8 @@ jobs: - name: Publish release # I might have to break it into steps to get the same output paths as debug #if: ${{ github.event_name != 'pull_request' }} # Publish CoseSignTool.exe and it's dependencies (all of the non-test projects) to published/release. - run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool/CoseSignTool.csproj - # run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool.sln + # run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool/CoseSignTool.csproj + run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool.sln - name: List published directory Windows # if: ${{ (runner.os == 'Windows') && (github.event_name != 'pull_request') }} @@ -88,4 +88,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - args: '/Users/runner/work/CoseSignTool/CoseSignTool/CoseSignTool/*/bin*/Release/*' + args: '/home/runner/work/CoseSignTool/CoseSignTool/published/release/*' From 3b06cfa7b77946edf3d6bd975e76027167368c0e Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 13:27:31 -0700 Subject: [PATCH 08/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index e12abf17..49fddedc 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -20,6 +20,8 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macOS-latest] + env: + CurrentRelease: $(git describe --tags `git rev-list --tags --max-count=1`) steps: - uses: actions/checkout@v3 @@ -79,13 +81,16 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + ReleaseId: $CurrentRelease args: '/home/runner/work/CoseSignTool/CoseSignTool/published/debug/*' - name: Upload release artifacts if: runner.os == 'Linux' - #if: ${{ github.event_name == 'release' }} + #if: ${{ github.event_name == 'release' }} + uses: skx/github-action-publish-binaries@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + ReleaseId: $CurrentRelease args: '/home/runner/work/CoseSignTool/CoseSignTool/published/release/*' From e0b334b41270bb17d2e7c12b638eaffb3fe23155 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 13:51:19 -0700 Subject: [PATCH 09/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 49fddedc..1ac97ffb 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -81,7 +81,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - ReleaseId: $CurrentRelease + ReleaseId: ${{ env.CurrentRelease }} args: '/home/runner/work/CoseSignTool/CoseSignTool/published/debug/*' - name: Upload release artifacts @@ -92,5 +92,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - ReleaseId: $CurrentRelease + ReleaseId: ${{ env.CurrentRelease }} args: '/home/runner/work/CoseSignTool/CoseSignTool/published/release/*' From 34a10b36d065c0b6cca5de73746da7f6bddbbbc0 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 14:09:52 -0700 Subject: [PATCH 10/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 1ac97ffb..2a1c39bd 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -21,7 +21,8 @@ jobs: matrix: os: [windows-latest, ubuntu-latest, macOS-latest] env: - CurrentRelease: $(git describe --tags `git rev-list --tags --max-count=1`) + # CurrentRelease: $(git describe --tags `git rev-list --tags --max-count=1`) + CurrentRelease: ${{ github.event.release.tag_name }} steps: - uses: actions/checkout@v3 From e14e1ce402f93fe5c0dc4604b9a8cc328018a16d Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 14:17:06 -0700 Subject: [PATCH 11/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 2a1c39bd..7eb64e5a 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -21,9 +21,8 @@ jobs: matrix: os: [windows-latest, ubuntu-latest, macOS-latest] env: - # CurrentRelease: $(git describe --tags `git rev-list --tags --max-count=1`) - CurrentRelease: ${{ github.event.release.tag_name }} - + #CurrentRelease: ${{ github.event.release.tag_name }} + CurrentRelease: v0.3.1 steps: - uses: actions/checkout@v3 - name: Setup .NET From b9a41936b303929a711c87dc2a3e7470b5616284 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 14:30:42 -0700 Subject: [PATCH 12/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 7eb64e5a..6658f353 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -81,7 +81,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - ReleaseId: ${{ env.CurrentRelease }} + ReleaseId: tag/${{ env.CurrentRelease }} args: '/home/runner/work/CoseSignTool/CoseSignTool/published/debug/*' - name: Upload release artifacts @@ -92,5 +92,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - ReleaseId: ${{ env.CurrentRelease }} + ReleaseId: tag/${{ env.CurrentRelease }} args: '/home/runner/work/CoseSignTool/CoseSignTool/published/release/*' From 5a745aae0e58a09beae7867eeb5d711a337bcd59 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:35:24 -0700 Subject: [PATCH 13/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 6658f353..cb3353b7 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -61,6 +61,14 @@ jobs: # run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool/CoseSignTool.csproj run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool.sln + - name: Create zip files for publication + # if: ${{ github.event_name == 'release' }} + run: | + zip -r CoseSignTool-debug.zip ./published/debug + zip -r CoseSignTool-release.zip ./published/release + shell: bash + working-directory: ./published + - name: List published directory Windows # if: ${{ (runner.os == 'Windows') && (github.event_name != 'pull_request') }} if: ${{ (runner.os == 'Windows') }} @@ -88,9 +96,15 @@ jobs: if: runner.os == 'Linux' #if: ${{ github.event_name == 'release' }} - uses: skx/github-action-publish-binaries@master + #uses: skx/github-action-publish-binaries@master + uses: actions/upload-release-asset@v1.01 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - ReleaseId: tag/${{ env.CurrentRelease }} - args: '/home/runner/work/CoseSignTool/CoseSignTool/published/release/*' + #ReleaseId: tag/${{ env.CurrentRelease }} + #args: '/home/runner/work/CoseSignTool/CoseSignTool/published/release/*' + upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/tag/v0.3.1/assets?name=CoseHandler.deps.json + asset_path: ./published/CoseSignTool-release.zip + asset_name: CoseSignTool-debug.zip + asset_content_type: application/zip + From e4ed8452f4b796bd8968d88c889313c7b83871ed Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:37:25 -0700 Subject: [PATCH 14/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index cb3353b7..9d0cf4e8 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -97,7 +97,7 @@ jobs: #if: ${{ github.event_name == 'release' }} #uses: skx/github-action-publish-binaries@master - uses: actions/upload-release-asset@v1.01 + uses: actions/upload-release-asset env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: From 5b42193bfb0c681ebce11c7ee2982780a393efb0 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 16:11:31 -0700 Subject: [PATCH 15/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 9d0cf4e8..35ba2d11 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -97,7 +97,7 @@ jobs: #if: ${{ github.event_name == 'release' }} #uses: skx/github-action-publish-binaries@master - uses: actions/upload-release-asset + uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: From c50c171cc3d7390e684a4d6ffbd3faf72840759c Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 18:33:27 -0700 Subject: [PATCH 16/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 35ba2d11..fe5aff10 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -64,8 +64,8 @@ jobs: - name: Create zip files for publication # if: ${{ github.event_name == 'release' }} run: | - zip -r CoseSignTool-debug.zip ./published/debug - zip -r CoseSignTool-release.zip ./published/release + zip -r CoseSignTool-debug.zip CoseSignTool-debug -x ./published/debug + zip -r CoseSignTool-release.zip CoseSignTool-release -x ./published/release shell: bash working-directory: ./published From 8315ffb43d05c3653a6955e709eb74e0fbd1cfdc Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 18:39:23 -0700 Subject: [PATCH 17/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index fe5aff10..1624599d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -64,8 +64,8 @@ jobs: - name: Create zip files for publication # if: ${{ github.event_name == 'release' }} run: | - zip -r CoseSignTool-debug.zip CoseSignTool-debug -x ./published/debug - zip -r CoseSignTool-release.zip CoseSignTool-release -x ./published/release + zip -r CoseSignTool-debug.zip CoseSignTool-debug -x /home/runner/work/CoseSignTool/CoseSignTool/published/debug + zip -r CoseSignTool-release.zip CoseSignTool-release -x /home/runner/work/CoseSignTool/CoseSignTool/published/release shell: bash working-directory: ./published From 79eb8a5a952e651d3f215ef23266d258c375a700 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 18:51:24 -0700 Subject: [PATCH 18/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 1624599d..69d434df 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -64,8 +64,8 @@ jobs: - name: Create zip files for publication # if: ${{ github.event_name == 'release' }} run: | - zip -r CoseSignTool-debug.zip CoseSignTool-debug -x /home/runner/work/CoseSignTool/CoseSignTool/published/debug - zip -r CoseSignTool-release.zip CoseSignTool-release -x /home/runner/work/CoseSignTool/CoseSignTool/published/release + zip -r CoseSignTool-debug.zip /home/runner/work/CoseSignTool/CoseSignTool/published/debug + zip -r CoseSignTool-release.zip /home/runner/work/CoseSignTool/CoseSignTool/published/release shell: bash working-directory: ./published From c2d11044af10a31ba702ccc07f633dd0657fd9a3 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:09:57 -0700 Subject: [PATCH 19/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 69d434df..c39fb63d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -50,22 +50,24 @@ jobs: # Another option to explore is to run them in a separate job that depands on ALL of the other jobs passing first. # Eventually we might want to tweak the CodeQL job to run on what we already built above so it isn't using resources to autobuild. - - name: Publish debug + - name: Publish outputs #if: ${{ github.event_name != 'pull_request' }} # Publish all of the non-test projects to published/release. We have to use the solution file to get the right output paths. - run: dotnet publish --no-build --configuration Debug --output published/debug CoseSignTool/CoseSignTool.sln - - - name: Publish release # I might have to break it into steps to get the same output paths as debug + run: | + dotnet publish --no-build --configuration Debug --output published/debug CoseSignTool/CoseSignTool.sln + dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool.sln + + #- name: Publish release # I might have to break it into steps to get the same output paths as debug #if: ${{ github.event_name != 'pull_request' }} # Publish CoseSignTool.exe and it's dependencies (all of the non-test projects) to published/release. # run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool/CoseSignTool.csproj - run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool.sln + # run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool.sln - - name: Create zip files for publication + - name: Create zip files for release # if: ${{ github.event_name == 'release' }} run: | - zip -r CoseSignTool-debug.zip /home/runner/work/CoseSignTool/CoseSignTool/published/debug - zip -r CoseSignTool-release.zip /home/runner/work/CoseSignTool/CoseSignTool/published/release + zip -r CoseSignTool-debug.zip /home/runner/work/CoseSignTool/CoseSignTool/published/debug/ + zip -r CoseSignTool-release.zip /home/runner/work/CoseSignTool/CoseSignTool/published/release/ shell: bash working-directory: ./published @@ -93,7 +95,7 @@ jobs: args: '/home/runner/work/CoseSignTool/CoseSignTool/published/debug/*' - name: Upload release artifacts - if: runner.os == 'Linux' + #if: runner.os == 'Linux' #if: ${{ github.event_name == 'release' }} #uses: skx/github-action-publish-binaries@master From b9e21cad0331b5486f63396cdca75e06e49eb925 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:19:35 -0700 Subject: [PATCH 20/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index c39fb63d..2c98d9eb 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -68,6 +68,8 @@ jobs: run: | zip -r CoseSignTool-debug.zip /home/runner/work/CoseSignTool/CoseSignTool/published/debug/ zip -r CoseSignTool-release.zip /home/runner/work/CoseSignTool/CoseSignTool/published/release/ + #upload_url=$(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') + #echo UPLOAD_URL=$upload_url >> $GITHUB_ENV shell: bash working-directory: ./published @@ -105,7 +107,8 @@ jobs: with: #ReleaseId: tag/${{ env.CurrentRelease }} #args: '/home/runner/work/CoseSignTool/CoseSignTool/published/release/*' - upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/tag/v0.3.1/assets?name=CoseHandler.deps.json + # upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/tag/v0.3.1/assets?name=CoseHandler.deps.json + upload_url: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') asset_path: ./published/CoseSignTool-release.zip asset_name: CoseSignTool-debug.zip asset_content_type: application/zip From 40cef46fc13a0c20bc4d4b3bbe90e8d0eacfb402 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:27:22 -0700 Subject: [PATCH 21/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 2c98d9eb..b2819def 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -107,9 +107,9 @@ jobs: with: #ReleaseId: tag/${{ env.CurrentRelease }} #args: '/home/runner/work/CoseSignTool/CoseSignTool/published/release/*' - # upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/tag/v0.3.1/assets?name=CoseHandler.deps.json - upload_url: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') + upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/tag/v0.3.1/assets + # upload_url: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') asset_path: ./published/CoseSignTool-release.zip - asset_name: CoseSignTool-debug.zip + asset_name: CoseSignTool-release.zip asset_content_type: application/zip From 03a62975e97e808a6498e84eaa0904482fdbcee9 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:31:00 -0700 Subject: [PATCH 22/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b2819def..a1f1b8ac 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -68,8 +68,8 @@ jobs: run: | zip -r CoseSignTool-debug.zip /home/runner/work/CoseSignTool/CoseSignTool/published/debug/ zip -r CoseSignTool-release.zip /home/runner/work/CoseSignTool/CoseSignTool/published/release/ - #upload_url=$(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') - #echo UPLOAD_URL=$upload_url >> $GITHUB_ENV + upload_url=$(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') + echo UPLOAD_URL=$upload_url #>> $GITHUB_ENV shell: bash working-directory: ./published @@ -107,7 +107,7 @@ jobs: with: #ReleaseId: tag/${{ env.CurrentRelease }} #args: '/home/runner/work/CoseSignTool/CoseSignTool/published/release/*' - upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/tag/v0.3.1/assets + upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/v0.3.1/assets # upload_url: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') asset_path: ./published/CoseSignTool-release.zip asset_name: CoseSignTool-release.zip From 6fa30d44cbb9230c8a303c776e95c7fa014ac728 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:37:15 -0700 Subject: [PATCH 23/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index a1f1b8ac..bef0b173 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -112,4 +112,5 @@ jobs: asset_path: ./published/CoseSignTool-release.zip asset_name: CoseSignTool-release.zip asset_content_type: application/zip + request_name: CoseSignTool-release.zip From a6af8b702bb3b9b0fadb36106d505af4365cf4d9 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:43:35 -0700 Subject: [PATCH 24/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index bef0b173..124adc7a 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -107,8 +107,8 @@ jobs: with: #ReleaseId: tag/${{ env.CurrentRelease }} #args: '/home/runner/work/CoseSignTool/CoseSignTool/published/release/*' - upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/v0.3.1/assets - # upload_url: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') + #upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/v0.3.1/assets/ + upload_url: https://uploads.github.com/repos/actions/checkout/releases/107995616/assets{?name,label} asset_path: ./published/CoseSignTool-release.zip asset_name: CoseSignTool-release.zip asset_content_type: application/zip From 5820fe15185c6ec882a24ab39a0b3fd680f34b39 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:49:26 -0700 Subject: [PATCH 25/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 124adc7a..ef643e40 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -97,7 +97,7 @@ jobs: args: '/home/runner/work/CoseSignTool/CoseSignTool/published/debug/*' - name: Upload release artifacts - #if: runner.os == 'Linux' + if: runner.os == 'Linux' # Need to re-test on other OS, but get linux working first #if: ${{ github.event_name == 'release' }} #uses: skx/github-action-publish-binaries@master From a2e316e3858d8268770514c7711a889fddf5398b Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Wed, 9 Aug 2023 17:23:18 -0700 Subject: [PATCH 26/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ef643e40..ae09c14b 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -66,8 +66,10 @@ jobs: - name: Create zip files for release # if: ${{ github.event_name == 'release' }} run: | - zip -r CoseSignTool-debug.zip /home/runner/work/CoseSignTool/CoseSignTool/published/debug/ - zip -r CoseSignTool-release.zip /home/runner/work/CoseSignTool/CoseSignTool/published/release/ + # zip -r CoseSignTool-debug.zip /home/runner/work/CoseSignTool/CoseSignTool/published/debug/ + # zip -r CoseSignTool-release.zip /home/runner/work/CoseSignTool/CoseSignTool/published/release/ + zip -r CoseSignTool-debug.zip ./debug/ + zip -r CoseSignTool-release.zip ./release/ upload_url=$(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') echo UPLOAD_URL=$upload_url #>> $GITHUB_ENV shell: bash @@ -88,13 +90,14 @@ jobs: working-directory: ./published - name: Upload debug artifacts - if: ${{ github.event_name == 'release' }} + if: ${{ github.event_name == 'release' }} uses: skx/github-action-publish-binaries@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - ReleaseId: tag/${{ env.CurrentRelease }} - args: '/home/runner/work/CoseSignTool/CoseSignTool/published/debug/*' + #ReleaseId: tag/${{ env.CurrentRelease }} + # args: '/home/runner/work/CoseSignTool/CoseSignTool/published/debug/*' + args: './published/debug/*' - name: Upload release artifacts if: runner.os == 'Linux' # Need to re-test on other OS, but get linux working first @@ -112,5 +115,5 @@ jobs: asset_path: ./published/CoseSignTool-release.zip asset_name: CoseSignTool-release.zip asset_content_type: application/zip - request_name: CoseSignTool-release.zip + #request_name: CoseSignTool-release.zip From f375a6be95e8c42e8fb55e5591cdc80dfd829595 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 14 Aug 2023 14:27:16 -0700 Subject: [PATCH 27/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ae09c14b..fc65e4df 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -102,18 +102,23 @@ jobs: - name: Upload release artifacts if: runner.os == 'Linux' # Need to re-test on other OS, but get linux working first #if: ${{ github.event_name == 'release' }} - - #uses: skx/github-action-publish-binaries@master - uses: actions/upload-release-asset@v1.0.2 + # #uses: skx/github-action-publish-binaries@master + uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + LastRelease: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') with: - #ReleaseId: tag/${{ env.CurrentRelease }} - #args: '/home/runner/work/CoseSignTool/CoseSignTool/published/release/*' - #upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/v0.3.1/assets/ - upload_url: https://uploads.github.com/repos/actions/checkout/releases/107995616/assets{?name,label} + upload_url: ${{ env.LastRelease }} asset_path: ./published/CoseSignTool-release.zip asset_name: CoseSignTool-release.zip asset_content_type: application/zip - #request_name: CoseSignTool-release.zip + # #ReleaseId: tag/${{ env.CurrentRelease }} + # #args: '/home/runner/work/CoseSignTool/CoseSignTool/published/release/*' + # #upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/v0.3.1/assets/ + # upload_url: https://uploads.github.com/repos/actions/checkout/releases/107995616/assets{?name,label} + # asset_path: ./published/CoseSignTool-release.zip + # asset_name: CoseSignTool-release.zip + # asset_content_type: application/zip + # #request_name: CoseSignTool-release.zip + From 9935cb7af6e09ad0b2495e152f07bff7561cc3b0 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 14 Aug 2023 14:31:42 -0700 Subject: [PATCH 28/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index fc65e4df..94e1482a 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -103,7 +103,7 @@ jobs: if: runner.os == 'Linux' # Need to re-test on other OS, but get linux working first #if: ${{ github.event_name == 'release' }} # #uses: skx/github-action-publish-binaries@master - uses: actions/upload-release-asset@v1 + uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} LastRelease: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') From 7ac0283846cb76e69adca9ad20475980016a2f00 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 14 Aug 2023 14:51:13 -0700 Subject: [PATCH 29/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 94e1482a..df88090c 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -23,6 +23,7 @@ jobs: env: #CurrentRelease: ${{ github.event.release.tag_name }} CurrentRelease: v0.3.1 + ReleasePath: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') steps: - uses: actions/checkout@v3 - name: Setup .NET @@ -106,12 +107,13 @@ jobs: uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - LastRelease: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') + #LastRelease: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') with: - upload_url: ${{ env.LastRelease }} + upload_url: ${{ env.ReleasePath }} asset_path: ./published/CoseSignTool-release.zip asset_name: CoseSignTool-release.zip asset_content_type: application/zip + # #ReleaseId: tag/${{ env.CurrentRelease }} # #args: '/home/runner/work/CoseSignTool/CoseSignTool/published/release/*' # #upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/v0.3.1/assets/ From eac776c03149c47602ca47b34502820ae9a07ec2 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 14 Aug 2023 15:06:50 -0700 Subject: [PATCH 30/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index df88090c..61cde120 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -23,7 +23,7 @@ jobs: env: #CurrentRelease: ${{ github.event.release.tag_name }} CurrentRelease: v0.3.1 - ReleasePath: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') + #ReleasePath: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') steps: - uses: actions/checkout@v3 - name: Setup .NET @@ -72,7 +72,7 @@ jobs: zip -r CoseSignTool-debug.zip ./debug/ zip -r CoseSignTool-release.zip ./release/ upload_url=$(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') - echo UPLOAD_URL=$upload_url #>> $GITHUB_ENV + echo UPLOAD_URL=$upload_url >> $GITHUB_ENV shell: bash working-directory: ./published @@ -109,7 +109,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} #LastRelease: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') with: - upload_url: ${{ env.ReleasePath }} + upload_url: ${{ env.UPLOAD_URL }} asset_path: ./published/CoseSignTool-release.zip asset_name: CoseSignTool-release.zip asset_content_type: application/zip From 93596c38df9c9c5dd1334acc22130c478cb79857 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 14 Aug 2023 15:23:23 -0700 Subject: [PATCH 31/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 61cde120..c8de249f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -109,7 +109,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} #LastRelease: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') with: - upload_url: ${{ env.UPLOAD_URL }} + #upload_url: ${{ env.UPLOAD_URL }} + upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/v0.3.1/assets/ asset_path: ./published/CoseSignTool-release.zip asset_name: CoseSignTool-release.zip asset_content_type: application/zip From 9673ac598bd7bba7c8099910c103c4792e430c8b Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 14 Aug 2023 16:12:23 -0700 Subject: [PATCH 32/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 46 ++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index c8de249f..5945ec6c 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -19,7 +19,17 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, ubuntu-latest, macOS-latest] + include: + - os: ubuntu-latest + artifact_name: mything + asset_name: mything-linux-amd64 + - os: windows-latest + artifact_name: mything.exe + asset_name: mything-windows-amd64 + - os: macos-latest + artifact_name: mything + asset_name: mything-macos-amd64 + # os: [windows-latest, ubuntu-latest, macOS-latest] env: #CurrentRelease: ${{ github.event.release.tag_name }} CurrentRelease: v0.3.1 @@ -102,26 +112,26 @@ jobs: - name: Upload release artifacts if: runner.os == 'Linux' # Need to re-test on other OS, but get linux working first - #if: ${{ github.event_name == 'release' }} + # if: ${{ github.event_name == 'release' }} # #uses: skx/github-action-publish-binaries@master - uses: actions/upload-release-asset@v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - #LastRelease: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') - with: - #upload_url: ${{ env.UPLOAD_URL }} - upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/v0.3.1/assets/ - asset_path: ./published/CoseSignTool-release.zip - asset_name: CoseSignTool-release.zip - asset_content_type: application/zip - - # #ReleaseId: tag/${{ env.CurrentRelease }} - # #args: '/home/runner/work/CoseSignTool/CoseSignTool/published/release/*' - # #upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/v0.3.1/assets/ - # upload_url: https://uploads.github.com/repos/actions/checkout/releases/107995616/assets{?name,label} + # uses: actions/upload-release-asset@v1.0.2 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # #LastRelease: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') + # with: + # #upload_url: ${{ env.UPLOAD_URL }} + # upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/v0.3.1/assets # asset_path: ./published/CoseSignTool-release.zip # asset_name: CoseSignTool-release.zip # asset_content_type: application/zip - # #request_name: CoseSignTool-release.zip + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./published/CoseSignTool-release.zip + asset_name: CoseSignTool-release.zip + #tag: ${{ github.ref }} + #file_glob: true + + From a568a6d39cb06b9e923c224461b3afa489ed61cb Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 14 Aug 2023 16:17:12 -0700 Subject: [PATCH 33/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 5945ec6c..67ddc319 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -129,7 +129,7 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ./published/CoseSignTool-release.zip asset_name: CoseSignTool-release.zip - #tag: ${{ github.ref }} + tag: v0.3.1 #file_glob: true From 19c412dae9f95b614f828f64c92dead929e93287 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 14 Aug 2023 17:04:58 -0700 Subject: [PATCH 34/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 92 ++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 51 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 67ddc319..577f9f08 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -20,15 +20,18 @@ jobs: strategy: matrix: include: - - os: ubuntu-latest - artifact_name: mything - asset_name: mything-linux-amd64 - os: windows-latest - artifact_name: mything.exe - asset_name: mything-windows-amd64 + dir_command: dir /b /a /s + zip_command_debug: powershell Compress-Archive -Path ./debug/ -DestinationPath CoseSignTool-debug.zip + zip_command_release: powershell Compress-Archive -Path ./release/ -DestinationPath CoseSignTool-release.zip + - os: ubuntu-latest + dir_command: ls -a -R + zip_command_debug: zip -r CoseSignTool-debug.zip ./debug/ + zip_command_release: zip -r CoseSignTool-release.zip ./release/ - os: macos-latest - artifact_name: mything - asset_name: mything-macos-amd64 + dir_command: ls -a -R + zip_command_debug: zip -r CoseSignTool-debug.zip ./debug/ + zip_command_release: zip -r CoseSignTool-release.zip ./release/ # os: [windows-latest, ubuntu-latest, macOS-latest] env: #CurrentRelease: ${{ github.event.release.tag_name }} @@ -48,13 +51,13 @@ jobs: - name: List working directory Windows if: runner.os == 'Windows' - run: dir /b /a /s - shell: cmd + run: ${{ matrix.dir_command }} + #shell: cmd - name: List working directory non-Windows if: runner.os != 'Windows' # TODO: Figure out how to set this in an environment variable so we only don't need separate steps. - run: ls -a -R - shell: bash + run: ${{ matrix.dir_command }} + #shell: bash # The remaining steps run only when changes are pushed to Main, i.e., when a pull request completes. # While we could run the publish steps in a parallel job, having them here forces them to wait until the unit tests pass. @@ -68,69 +71,56 @@ jobs: dotnet publish --no-build --configuration Debug --output published/debug CoseSignTool/CoseSignTool.sln dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool.sln - #- name: Publish release # I might have to break it into steps to get the same output paths as debug - #if: ${{ github.event_name != 'pull_request' }} - # Publish CoseSignTool.exe and it's dependencies (all of the non-test projects) to published/release. - # run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool/CoseSignTool.csproj - # run: dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool.sln - - name: Create zip files for release # if: ${{ github.event_name == 'release' }} run: | - # zip -r CoseSignTool-debug.zip /home/runner/work/CoseSignTool/CoseSignTool/published/debug/ - # zip -r CoseSignTool-release.zip /home/runner/work/CoseSignTool/CoseSignTool/published/release/ - zip -r CoseSignTool-debug.zip ./debug/ - zip -r CoseSignTool-release.zip ./release/ - upload_url=$(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') - echo UPLOAD_URL=$upload_url >> $GITHUB_ENV - shell: bash + ${{ matrix.zip_command_debug }} + ${{ matrix.zip_command_release }} + # zip -r CoseSignTool-debug.zip ./debug/ + # zip -r CoseSignTool-release.zip ./release/ + # shell: bash working-directory: ./published + # [IO.Compression.ZipFile]::CreateFromDirectory + #upload_url=$(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') + #echo UPLOAD_URL=$upload_url >> $GITHUB_ENV + # zip -r CoseSignTool-debug.zip /home/runner/work/CoseSignTool/CoseSignTool/published/debug/ + # zip -r CoseSignTool-release.zip /home/runner/work/CoseSignTool/CoseSignTool/published/release/ + - name: List published directory Windows # if: ${{ (runner.os == 'Windows') && (github.event_name != 'pull_request') }} if: ${{ (runner.os == 'Windows') }} - run: dir /b /a /s - shell: cmd + run: ${{ matrix.dir_command }} + # shell: cmd working-directory: ./published - name: List published directory non-Windows # if: ${{ (runner.os != 'Windows') && (github.event_name != 'pull_request') }} if: ${{ (runner.os != 'Windows') }} - run: ls -a -R - shell: bash + run: ${{ matrix.dir_command }} + # shell: bash working-directory: ./published - - name: Upload debug artifacts - if: ${{ github.event_name == 'release' }} - uses: skx/github-action-publish-binaries@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - #ReleaseId: tag/${{ env.CurrentRelease }} - # args: '/home/runner/work/CoseSignTool/CoseSignTool/published/debug/*' - args: './published/debug/*' + # - name: Upload debug artifacts + # if: ${{ github.event_name == 'release' }} + # uses: skx/github-action-publish-binaries@master + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # #ReleaseId: tag/${{ env.CurrentRelease }} + # # args: '/home/runner/work/CoseSignTool/CoseSignTool/published/debug/*' + # args: './published/debug/*' - name: Upload release artifacts - if: runner.os == 'Linux' # Need to re-test on other OS, but get linux working first + #if: runner.os == 'Linux' # Need to re-test on other OS, but get linux working first # if: ${{ github.event_name == 'release' }} - # #uses: skx/github-action-publish-binaries@master - # uses: actions/upload-release-asset@v1.0.2 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # #LastRelease: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') - # with: - # #upload_url: ${{ env.UPLOAD_URL }} - # upload_url: https://uploads.github.com/repos/microsoft/CoseSignTool/releases/v0.3.1/assets - # asset_path: ./published/CoseSignTool-release.zip - # asset_name: CoseSignTool-release.zip - # asset_content_type: application/zip uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ./published/CoseSignTool-release.zip - asset_name: CoseSignTool-release.zip + #asset_name: CoseSignTool-release.zip tag: v0.3.1 - #file_glob: true + #file_glob: true (turn this on if we want to upload all files in the directory) From 3bd9582afaef8d3b8909a9329d1b8bcf9b296983 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 14 Aug 2023 17:12:11 -0700 Subject: [PATCH 35/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 577f9f08..30b231a6 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -112,7 +112,7 @@ jobs: # args: './published/debug/*' - name: Upload release artifacts - #if: runner.os == 'Linux' # Need to re-test on other OS, but get linux working first + if: runner.os != 'Linux' # Need to re-test on other OS, but get linux working first # if: ${{ github.event_name == 'release' }} uses: svenstaro/upload-release-action@v2 with: From 69aa96cddbac90b0f4f0850cf5b56778bc7a7be3 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 14 Aug 2023 17:23:38 -0700 Subject: [PATCH 36/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 30b231a6..6854d8b4 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -32,7 +32,6 @@ jobs: dir_command: ls -a -R zip_command_debug: zip -r CoseSignTool-debug.zip ./debug/ zip_command_release: zip -r CoseSignTool-release.zip ./release/ - # os: [windows-latest, ubuntu-latest, macOS-latest] env: #CurrentRelease: ${{ github.event.release.tag_name }} CurrentRelease: v0.3.1 @@ -47,17 +46,15 @@ jobs: - name: Build and Test debug # Use dotnet test to run Restore, Build, and Test, all in one sweep. run: dotnet test --verbosity normal CoseSignTool/CoseSignTool.sln - shell: bash + #shell: bash - name: List working directory Windows if: runner.os == 'Windows' run: ${{ matrix.dir_command }} - #shell: cmd - name: List working directory non-Windows if: runner.os != 'Windows' # TODO: Figure out how to set this in an environment variable so we only don't need separate steps. run: ${{ matrix.dir_command }} - #shell: bash # The remaining steps run only when changes are pushed to Main, i.e., when a pull request completes. # While we could run the publish steps in a parallel job, having them here forces them to wait until the unit tests pass. @@ -78,7 +75,6 @@ jobs: ${{ matrix.zip_command_release }} # zip -r CoseSignTool-debug.zip ./debug/ # zip -r CoseSignTool-release.zip ./release/ - # shell: bash working-directory: ./published # [IO.Compression.ZipFile]::CreateFromDirectory @@ -112,7 +108,7 @@ jobs: # args: './published/debug/*' - name: Upload release artifacts - if: runner.os != 'Linux' # Need to re-test on other OS, but get linux working first + if: runner.os == 'Windows' # Need to re-test on other OS, but get linux working first # if: ${{ github.event_name == 'release' }} uses: svenstaro/upload-release-action@v2 with: From 2c6b71686dca04fcb09eb8be5052910555f0d4f4 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 14 Aug 2023 17:32:15 -0700 Subject: [PATCH 37/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 6854d8b4..be95d5e1 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -108,7 +108,7 @@ jobs: # args: './published/debug/*' - name: Upload release artifacts - if: runner.os == 'Windows' # Need to re-test on other OS, but get linux working first + # if: runner.os == 'Windows' # Need to re-test on other OS, but get linux working first # if: ${{ github.event_name == 'release' }} uses: svenstaro/upload-release-action@v2 with: From d61164cdffeddfa8f0bccea49018cefee552fd98 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 14 Aug 2023 17:38:29 -0700 Subject: [PATCH 38/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index be95d5e1..b8fe496f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -49,12 +49,12 @@ jobs: #shell: bash - name: List working directory Windows - if: runner.os == 'Windows' + # if: runner.os == 'Windows' run: ${{ matrix.dir_command }} - - name: List working directory non-Windows - if: runner.os != 'Windows' # TODO: Figure out how to set this in an environment variable so we only don't need separate steps. - run: ${{ matrix.dir_command }} + # - name: List working directory non-Windows + # if: runner.os != 'Windows' # TODO: Figure out how to set this in an environment variable so we only don't need separate steps. + # run: ${{ matrix.dir_command }} # The remaining steps run only when changes are pushed to Main, i.e., when a pull request completes. # While we could run the publish steps in a parallel job, having them here forces them to wait until the unit tests pass. @@ -85,17 +85,17 @@ jobs: - name: List published directory Windows # if: ${{ (runner.os == 'Windows') && (github.event_name != 'pull_request') }} - if: ${{ (runner.os == 'Windows') }} + # if: ${{ (runner.os == 'Windows') }} run: ${{ matrix.dir_command }} # shell: cmd working-directory: ./published - - name: List published directory non-Windows - # if: ${{ (runner.os != 'Windows') && (github.event_name != 'pull_request') }} - if: ${{ (runner.os != 'Windows') }} - run: ${{ matrix.dir_command }} - # shell: bash - working-directory: ./published + # - name: List published directory non-Windows + # # if: ${{ (runner.os != 'Windows') && (github.event_name != 'pull_request') }} + # if: ${{ (runner.os != 'Windows') }} + # run: ${{ matrix.dir_command }} + # # shell: bash + # working-directory: ./published # - name: Upload debug artifacts # if: ${{ github.event_name == 'release' }} @@ -108,8 +108,8 @@ jobs: # args: './published/debug/*' - name: Upload release artifacts - # if: runner.os == 'Windows' # Need to re-test on other OS, but get linux working first - # if: ${{ github.event_name == 'release' }} + # if: ${{ runner.os == 'Windows' }} # Need to re-test on other OS, but get linux working first + if: ${{ github.event_name == 'release' }} uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} From 255558569a9b54c418e2b849219c9101ac9f16df Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 14 Aug 2023 17:45:22 -0700 Subject: [PATCH 39/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b8fe496f..cd46b2ca 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -21,7 +21,7 @@ jobs: matrix: include: - os: windows-latest - dir_command: dir /b /a /s + dir_command: dir /b /a -recurse zip_command_debug: powershell Compress-Archive -Path ./debug/ -DestinationPath CoseSignTool-debug.zip zip_command_release: powershell Compress-Archive -Path ./release/ -DestinationPath CoseSignTool-release.zip - os: ubuntu-latest @@ -108,8 +108,8 @@ jobs: # args: './published/debug/*' - name: Upload release artifacts - # if: ${{ runner.os == 'Windows' }} # Need to re-test on other OS, but get linux working first - if: ${{ github.event_name == 'release' }} + if: runner.os == 'Windows' # Need to re-test on other OS, but get linux working first + # if: ${{ github.event_name == 'release' }} uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} From 88828b5d9cc8d0a534e1dd8d7b4595b41b4305d6 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 14 Aug 2023 17:49:35 -0700 Subject: [PATCH 40/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index cd46b2ca..eb0400d0 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -21,7 +21,7 @@ jobs: matrix: include: - os: windows-latest - dir_command: dir /b /a -recurse + dir_command: cmd dir /b /a /s zip_command_debug: powershell Compress-Archive -Path ./debug/ -DestinationPath CoseSignTool-debug.zip zip_command_release: powershell Compress-Archive -Path ./release/ -DestinationPath CoseSignTool-release.zip - os: ubuntu-latest From 88f020be504f4028b62d9c0669c24afb985effab Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 15 Aug 2023 10:19:44 -0700 Subject: [PATCH 41/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 59 +++++++++++------------------------- 1 file changed, 18 insertions(+), 41 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index eb0400d0..4bbbe33a 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,4 +1,4 @@ -# This workflow will build a .NET project +# Build, test, publish, and upload a release of CoseSignTool # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net name: Pull Request and Continuous Integration Build @@ -8,10 +8,6 @@ on: pull_request: branches: [ "*" ] release: - #workflow_call: - # Use "Inputs" and "Secrets" to pass values from caller if needed - # You can then use the ${{ inputs.variable-name }} and ${{ secrets.envPAT }} syntax to access them - # See https://docs.github.com/en/actions/using-workflows/reusing-workflows for more info jobs: build: @@ -21,21 +17,21 @@ jobs: matrix: include: - os: windows-latest - dir_command: cmd dir /b /a /s - zip_command_debug: powershell Compress-Archive -Path ./debug/ -DestinationPath CoseSignTool-debug.zip - zip_command_release: powershell Compress-Archive -Path ./release/ -DestinationPath CoseSignTool-release.zip + dir_command: gci -Recurse # If I don't like the output format, switch to Shell: cmd + zip_command_debug: Compress-Archive -Path ./debug/ -DestinationPath CoseSignTool-Windows-debug.zip + zip_command_release: Compress-Archive -Path ./release/ -DestinationPath CoseSignTool-Windows-release.zip + command_shell: cmd - os: ubuntu-latest dir_command: ls -a -R - zip_command_debug: zip -r CoseSignTool-debug.zip ./debug/ - zip_command_release: zip -r CoseSignTool-release.zip ./release/ + zip_command_debug: zip -r CoseSignTool-Linux-debug.zip ./debug/ + zip_command_release: zip -r CoseSignTool-Linux-release.zip ./release/ + command_shell: bash - os: macos-latest dir_command: ls -a -R - zip_command_debug: zip -r CoseSignTool-debug.zip ./debug/ - zip_command_release: zip -r CoseSignTool-release.zip ./release/ - env: - #CurrentRelease: ${{ github.event.release.tag_name }} - CurrentRelease: v0.3.1 - #ReleasePath: $(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') + zip_command_debug: zip -r CoseSignTool-MacOS-debug.zip ./debug/ + zip_command_release: zip -r CoseSignTool-MacOS-release.zip ./release/ + command_shell: bash + steps: - uses: actions/checkout@v3 - name: Setup .NET @@ -84,39 +80,20 @@ jobs: # zip -r CoseSignTool-release.zip /home/runner/work/CoseSignTool/CoseSignTool/published/release/ - name: List published directory Windows - # if: ${{ (runner.os == 'Windows') && (github.event_name != 'pull_request') }} - # if: ${{ (runner.os == 'Windows') }} + # if: ${{ github.event_name != 'pull_request' }} run: ${{ matrix.dir_command }} - # shell: cmd working-directory: ./published - - # - name: List published directory non-Windows - # # if: ${{ (runner.os != 'Windows') && (github.event_name != 'pull_request') }} - # if: ${{ (runner.os != 'Windows') }} - # run: ${{ matrix.dir_command }} - # # shell: bash - # working-directory: ./published - - # - name: Upload debug artifacts - # if: ${{ github.event_name == 'release' }} - # uses: skx/github-action-publish-binaries@master - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # #ReleaseId: tag/${{ env.CurrentRelease }} - # # args: '/home/runner/work/CoseSignTool/CoseSignTool/published/debug/*' - # args: './published/debug/*' - name: Upload release artifacts - if: runner.os == 'Windows' # Need to re-test on other OS, but get linux working first - # if: ${{ github.event_name == 'release' }} + #if: runner.os == 'Windows' # Need to re-test on other OS, but get linux working first + #if: ${{ github.event_name == 'release' }} uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ./published/CoseSignTool-release.zip - #asset_name: CoseSignTool-release.zip + file: ./published/CoseSignTool-*.zip tag: v0.3.1 - #file_glob: true (turn this on if we want to upload all files in the directory) + file_glob: true #(turn this on if we want to upload all files in the directory) + From de9312c1981b93f1bf8806033a53bc332ac88e40 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 15 Aug 2023 11:36:51 -0700 Subject: [PATCH 42/48] finalize build workflow CLean up build workflow, make CodeQL build faster --- .github/workflows/codeql.yml | 25 +++++++++++------ .github/workflows/dotnet.yml | 54 +++++++++++++----------------------- 2 files changed, 37 insertions(+), 42 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 21468463..d1744128 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -20,7 +20,6 @@ on: jobs: analyze: name: Analyze - # needs: build-${{matrix.os}} runs-on: ${{ matrix.os }} permissions: actions: read @@ -31,14 +30,15 @@ jobs: fail-fast: false matrix: language: [ 'csharp' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Use only 'java' to analyze code written in Java, Kotlin or both - # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - os: [windows-latest] #, ubuntu-latest, macOS-latest] + os: [windows-latest, ubuntu-latest, macOS-latest] steps: - name: Checkout repository uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL @@ -52,11 +52,20 @@ jobs: # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs # queries: security-extended,security-and-quality +# TODO: Instead of autobuild, see if we can speed things up + # We could insert the CodeQL process into the build script so we only have to build once, but it would be synchronous and add 3.5 minutes to the build script. + # The build script takes about 1/2 as long to build as AutoBuild, so try using that. # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 + # - name: Autobuild + # uses: github/codeql-action/autobuild@v2 + + + + # Use the Dotnet Build command to load dependencies and build the code. + - name: Build and Test debug + run: dotnet build --verbosity normal CoseSignTool/CoseSignTool.sln # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 4bbbe33a..3145dd87 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -17,20 +17,17 @@ jobs: matrix: include: - os: windows-latest - dir_command: gci -Recurse # If I don't like the output format, switch to Shell: cmd + dir_command: gci -Recurse zip_command_debug: Compress-Archive -Path ./debug/ -DestinationPath CoseSignTool-Windows-debug.zip zip_command_release: Compress-Archive -Path ./release/ -DestinationPath CoseSignTool-Windows-release.zip - command_shell: cmd - os: ubuntu-latest dir_command: ls -a -R zip_command_debug: zip -r CoseSignTool-Linux-debug.zip ./debug/ zip_command_release: zip -r CoseSignTool-Linux-release.zip ./release/ - command_shell: bash - os: macos-latest dir_command: ls -a -R zip_command_debug: zip -r CoseSignTool-MacOS-debug.zip ./debug/ zip_command_release: zip -r CoseSignTool-MacOS-release.zip ./release/ - command_shell: bash steps: - uses: actions/checkout@v3 @@ -38,61 +35,50 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: 7.0.x - + + #### This workflow runs on all platforms and handles three different types of builds: + # 1. Pull request builds: These are triggered by a pull request. They build and test the code, but do not publish or upload release artifacts. + # 2. Continuous integration builds: These are triggered by a push to the main branch. They build, test, and publish binaries for local use. + # 3. Release builds: These are triggered by a release, which is created manually. They build, test, and publish binaries, and then zip and upload them to the release. + + # Use the Dotnet Test command to load dependencies, build, and test the code. - name: Build and Test debug - # Use dotnet test to run Restore, Build, and Test, all in one sweep. run: dotnet test --verbosity normal CoseSignTool/CoseSignTool.sln - #shell: bash - - name: List working directory Windows - # if: runner.os == 'Windows' + - name: List working directory run: ${{ matrix.dir_command }} - - # - name: List working directory non-Windows - # if: runner.os != 'Windows' # TODO: Figure out how to set this in an environment variable so we only don't need separate steps. - # run: ${{ matrix.dir_command }} - - # The remaining steps run only when changes are pushed to Main, i.e., when a pull request completes. - # While we could run the publish steps in a parallel job, having them here forces them to wait until the unit tests pass. - # Another option to explore is to run them in a separate job that depands on ALL of the other jobs passing first. - # Eventually we might want to tweak the CodeQL job to run on what we already built above so it isn't using resources to autobuild. + # If this is a pull request build, we're done. Otherwise, publish the binaries to ./published. + # Note: We have to use the solution files to get the right output paths, due to the mix of .NET 7 and .NET Standard projects. - name: Publish outputs - #if: ${{ github.event_name != 'pull_request' }} - # Publish all of the non-test projects to published/release. We have to use the solution file to get the right output paths. + if: ${{ github.event_name != 'pull_request' }} run: | dotnet publish --no-build --configuration Debug --output published/debug CoseSignTool/CoseSignTool.sln dotnet publish --configuration Release --output published/release CoseSignTool/CoseSignTool.sln + # Create zip files for release builds. Skip this step for continuous integration builds. - name: Create zip files for release - # if: ${{ github.event_name == 'release' }} + if: ${{ github.event_name == 'release' }} run: | ${{ matrix.zip_command_debug }} ${{ matrix.zip_command_release }} - # zip -r CoseSignTool-debug.zip ./debug/ - # zip -r CoseSignTool-release.zip ./release/ working-directory: ./published - # [IO.Compression.ZipFile]::CreateFromDirectory - #upload_url=$(curl -sL https://api.github.com/repos/actions/checkout/releases/latest | jq -r '.upload_url') - #echo UPLOAD_URL=$upload_url >> $GITHUB_ENV - # zip -r CoseSignTool-debug.zip /home/runner/work/CoseSignTool/CoseSignTool/published/debug/ - # zip -r CoseSignTool-release.zip /home/runner/work/CoseSignTool/CoseSignTool/published/release/ - + # List the contents of the published directory to make sure all the artifacts are there. - name: List published directory Windows - # if: ${{ github.event_name != 'pull_request' }} + if: ${{ github.event_name != 'pull_request' }} run: ${{ matrix.dir_command }} working-directory: ./published + # If this is a release build, upload the zipped artifacts. - name: Upload release artifacts - #if: runner.os == 'Windows' # Need to re-test on other OS, but get linux working first - #if: ${{ github.event_name == 'release' }} + if: ${{ github.event_name == 'release' }} uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ./published/CoseSignTool-*.zip - tag: v0.3.1 - file_glob: true #(turn this on if we want to upload all files in the directory) + #tag: v0.3.1 # Use hard-coded tags for testing. Otherwise, default to the tag of the release. + file_glob: true From feb0581bce03d4916444201009f3872a23ced497 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:05:17 -0700 Subject: [PATCH 43/48] add more CodeQL queries --- .github/workflows/codeql.yml | 48 ++++++------------------------------ .github/workflows/dotnet.yml | 1 + 2 files changed, 8 insertions(+), 41 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d1744128..963ca840 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,19 +1,8 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# +# Run CodeQL Analysis on the repository. +# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/codeql-code-scanning-for-compiled-languages name: "CodeQL" on: - push: - branches: [ "main" ] pull_request: branches: [ "*" ] @@ -31,6 +20,7 @@ jobs: matrix: language: [ 'csharp' ] os: [windows-latest, ubuntu-latest, macOS-latest] + steps: - name: Checkout repository uses: actions/checkout@v3 @@ -45,38 +35,14 @@ jobs: uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - -# TODO: Instead of autobuild, see if we can speed things up - # We could insert the CodeQL process into the build script so we only have to build once, but it would be synchronous and add 3.5 minutes to the build script. - # The build script takes about 1/2 as long to build as AutoBuild, so try using that. - - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - # - name: Autobuild - # uses: github/codeql-action/autobuild@v2 - - + queries: +security-extended +security-and-quality + # We can append additional queries with a '+' sign. See https://codeql.github.com/codeql-query-help/csharp/ for a list of available C# queries. # Use the Dotnet Build command to load dependencies and build the code. - - name: Build and Test debug + - name: Build debug run: dotnet build --verbosity normal CoseSignTool/CoseSignTool.sln - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - + # Do the analysis - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 with: diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 3145dd87..acc3309d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -71,6 +71,7 @@ jobs: working-directory: ./published # If this is a release build, upload the zipped artifacts. + # TODO: This step should require successful completion of all the validation workflows, once they are all working as intended. - name: Upload release artifacts if: ${{ github.event_name == 'release' }} uses: svenstaro/upload-release-action@v2 From c82adc7fa3473dac95771dc4d5a97b7cdb087c2b Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:18:42 -0700 Subject: [PATCH 44/48] codeQL tweak --- .github/workflows/codeql.yml | 2 +- .github/workflows/dotnet.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 963ca840..73735208 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -35,7 +35,7 @@ jobs: uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} - queries: +security-extended +security-and-quality + queries: security-extended + security-and-quality # We can append additional queries with a '+' sign. See https://codeql.github.com/codeql-query-help/csharp/ for a list of available C# queries. # Use the Dotnet Build command to load dependencies and build the code. diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index acc3309d..3145dd87 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -71,7 +71,6 @@ jobs: working-directory: ./published # If this is a release build, upload the zipped artifacts. - # TODO: This step should require successful completion of all the validation workflows, once they are all working as intended. - name: Upload release artifacts if: ${{ github.event_name == 'release' }} uses: svenstaro/upload-release-action@v2 From 2e81e08961505da22007b3b4d775a446c1e6169f Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:25:23 -0700 Subject: [PATCH 45/48] Update codeql.yml --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 73735208..7d6eff7f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -35,7 +35,7 @@ jobs: uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} - queries: security-extended + security-and-quality + queries: +security-extended, +security-and-quality # We can append additional queries with a '+' sign. See https://codeql.github.com/codeql-query-help/csharp/ for a list of available C# queries. # Use the Dotnet Build command to load dependencies and build the code. From 39509dc6fb303a15913995299313f2ebbc1abdf7 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:31:10 -0700 Subject: [PATCH 46/48] comma no plus --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 7d6eff7f..85b64b3f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -35,7 +35,7 @@ jobs: uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} - queries: +security-extended, +security-and-quality + queries: security-extended,security-and-quality # We can append additional queries with a '+' sign. See https://codeql.github.com/codeql-query-help/csharp/ for a list of available C# queries. # Use the Dotnet Build command to load dependencies and build the code. From ab48c94534025ae3941b57c6da146ce7c7ee5523 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:46:34 -0700 Subject: [PATCH 47/48] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 3145dd87..7dbb3ac8 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -8,7 +8,7 @@ on: pull_request: branches: [ "*" ] release: - + types: [created] jobs: build: name: build-${{matrix.os}} From 11ad4649deef68094a21aabcb214a2104b1227ac Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Tue, 15 Aug 2023 13:04:32 -0700 Subject: [PATCH 48/48] cleanup --- .github/workflows/codeql.yml | 8 ++++---- .github/workflows/dotnet.yml | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 85b64b3f..1f216b34 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'csharp' ] + #language: [ 'csharp' ] os: [windows-latest, ubuntu-latest, macOS-latest] steps: @@ -34,9 +34,9 @@ jobs: - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: - languages: ${{ matrix.language }} + languages: 'csharp' queries: security-extended,security-and-quality - # We can append additional queries with a '+' sign. See https://codeql.github.com/codeql-query-help/csharp/ for a list of available C# queries. + # See https://codeql.github.com/codeql-query-help/csharp/ for a list of available C# queries. # Use the Dotnet Build command to load dependencies and build the code. - name: Build debug @@ -46,4 +46,4 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 with: - category: "/language:${{matrix.language}}" + category: "/language:csharp" diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 7dbb3ac8..5f5a0cb3 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,7 +1,7 @@ # Build, test, publish, and upload a release of CoseSignTool # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net -name: Pull Request and Continuous Integration Build +name: Build, Test, and Publish on: push: branches: [ "main" ] @@ -65,7 +65,7 @@ jobs: working-directory: ./published # List the contents of the published directory to make sure all the artifacts are there. - - name: List published directory Windows + - name: List published directory if: ${{ github.event_name != 'pull_request' }} run: ${{ matrix.dir_command }} working-directory: ./published @@ -77,8 +77,8 @@ jobs: with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ./published/CoseSignTool-*.zip - #tag: v0.3.1 # Use hard-coded tags for testing. Otherwise, default to the tag of the release. file_glob: true + overwrite: true