From 9a3338c6747d27970445394d4b07f357e2f521e1 Mon Sep 17 00:00:00 2001 From: lemccomb <117306942+lemccomb@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:31:55 -0700 Subject: [PATCH] Fix rerelease workflow again (#107) Add a workflow to rerelease assets for existing releases * Restore workflow, include CoseSign1.Headers tests * Update changelog for release --------- Signed-off-by: lemccomb <117306942+lemccomb@users.noreply.github.com> Co-authored-by: GitHub Action --- .github/workflows/dotnet.yml | 1 + .github/workflows/rerelease.yml | 40 ++++++++++++++++----------- CHANGELOG.md | 48 +++++++++++++++++++-------------- 3 files changed, 53 insertions(+), 36 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ad8208fd..61af0918 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -53,6 +53,7 @@ jobs: dotnet build --configuration Debug CoseSignTool.sln dotnet test --no-restore CoseSign1.Tests/CoseSign1.Tests.csproj dotnet test --no-restore CoseSign1.Certificates.Tests/CoseSign1.Certificates.Tests.csproj + dotnet test --no-restore CoseSign1.Headers.Tests/CoseSign1.Headers.Tests.csproj dotnet test --no-restore CoseIndirectSignature.Tests/CoseIndirectSignature.Tests.csproj dotnet test --no-restore CoseHandler.Tests/CoseHandler.Tests.csproj dotnet test --no-restore CoseSignTool.Tests/CoseSignTool.Tests.csproj --verbosity detailed diff --git a/.github/workflows/rerelease.yml b/.github/workflows/rerelease.yml index 0982a356..907c0ba1 100644 --- a/.github/workflows/rerelease.yml +++ b/.github/workflows/rerelease.yml @@ -7,13 +7,13 @@ on: workflow_dispatch: inputs: oldest: - description: 'Oldest release to include' + description: 'Oldest release to include' # ${{ github.event.inputs.oldest }} required: true - default: 'v0.3.1' + default: 'v1.2.3' newest: description: 'Newest release to include' required: true - default: 'current' + default: 'v1.2.4' jobs: release_assets_by_tag: @@ -31,26 +31,29 @@ jobs: matrix: include: - os: windows-latest - 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 + zip_command_debug: zip --quiet -r CoseSignTool-Windows-debug.zip ./published/debug/ + zip_command_release: zip --quiet -r CoseSignTool-Windows-release.zip ./published/release/ - 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/ + zip_command_debug: zip --quiet -r CoseSignTool-Linux-debug.zip ./published/debug/ + zip_command_release: zip --quiet -r CoseSignTool-Linux-release.zip ./published/release/ - 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/ + zip_command_debug: zip --quiet -r CoseSignTool-MacOS-debug.zip ./published/debug/ + zip_command_release: zip --quiet -r CoseSignTool-MacOS-release.zip ./published/release/ steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Install Zip command + if: ${{ matrix.os == 'windows-latest' }} + run: choco install zip + - name: Get list of tags run: | + oldest=${{ github.event.inputs.oldest }} + newest=${{ github.event.inputs.newest }} git fetch --quiet - tags=$(git tag --list --sort=version:refname | awk -v old=${{ github.event.inputs.oldest }} -v new=${{ github.event.inputs.newest }} '$0 >= old && $0 <= new') + tags=$(git tag --list --sort=version:refname | awk -v old=$oldest -v new=$newest '$0 >= old && $0 <= new') echo "tags = $tags" echo "tagsToUpdate=$(echo $tags)" >> $GITHUB_ENV shell: bash @@ -59,10 +62,13 @@ jobs: run: | git fetch --tags for tag in ${{ env.tagsToUpdate }}; do + echo "**** Checkout $tag ****" + git checkout "$tag" --quiet + echo "**** Build and publish $tag ****" - git checkout "$tag" dotnet publish --configuration Debug --self-contained true --output published/debug CoseSignTool/CoseSignTool.csproj dotnet publish --configuration Release --self-contained true --output published/release CoseSignTool/CoseSignTool.csproj + echo "publish succeeded" echo "**** Copy documentation for $tag ****" for folder in debug release; do @@ -75,10 +81,12 @@ jobs: echo "**** Create zip files for $tag ****" ${{ matrix.zip_command_debug }} ${{ matrix.zip_command_release }} - ${{ matrix.dir_command }} + find . -type f -name "*.zip" echo "**** Upload zip files to GitHub ****" - gh release upload $tag ./published/CoseSignTool-*.zip + gh release upload $tag ./CoseSignTool-*.zip --clobber done shell: bash + env: + GH_TOKEN: ${{ github.token }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fcb85b9..10d979da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [v1.2.7-pre3](https://github.com/microsoft/CoseSignTool/tree/v1.2.7-pre3) (2024-08-26) + +[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.7-pre2...v1.2.7-pre3) + +**Merged pull requests:** + +- User/lemccomb/re release workflow3 [\#106](https://github.com/microsoft/CoseSignTool/pull/106) ([lemccomb](https://github.com/lemccomb)) + ## [v1.2.7-pre2](https://github.com/microsoft/CoseSignTool/tree/v1.2.7-pre2) (2024-08-23) [Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.7-pre1...v1.2.7-pre2) @@ -30,19 +38,19 @@ ## [v1.2.6-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.2.6-pre1) (2024-08-21) -[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.6...v1.2.6-pre1) +[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.5-pre3...v1.2.6-pre1) **Merged pull requests:** - Publish self-contained [\#101](https://github.com/microsoft/CoseSignTool/pull/101) ([lemccomb](https://github.com/lemccomb)) -## [v1.2.6](https://github.com/microsoft/CoseSignTool/tree/v1.2.6) (2024-08-19) +## [v1.2.5-pre3](https://github.com/microsoft/CoseSignTool/tree/v1.2.5-pre3) (2024-08-19) -[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.5-pre3...v1.2.6) +[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.6...v1.2.5-pre3) -## [v1.2.5-pre3](https://github.com/microsoft/CoseSignTool/tree/v1.2.5-pre3) (2024-08-19) +## [v1.2.6](https://github.com/microsoft/CoseSignTool/tree/v1.2.6) (2024-08-19) -[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.5-pre2...v1.2.5-pre3) +[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.5-pre2...v1.2.6) **Merged pull requests:** @@ -138,19 +146,19 @@ ## [v1.2.3-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.2.3-pre1) (2024-05-31) -[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.3...v1.2.3-pre1) +[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.2-pre1...v1.2.3-pre1) **Merged pull requests:** - upgrade to .NET 8, add docs to package, add retry loop for revocation server [\#89](https://github.com/microsoft/CoseSignTool/pull/89) ([lemccomb](https://github.com/lemccomb)) -## [v1.2.3](https://github.com/microsoft/CoseSignTool/tree/v1.2.3) (2024-03-20) +## [v1.2.2-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.2.2-pre1) (2024-03-20) -[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.2-pre1...v1.2.3) +[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.3...v1.2.2-pre1) -## [v1.2.2-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.2.2-pre1) (2024-03-20) +## [v1.2.3](https://github.com/microsoft/CoseSignTool/tree/v1.2.3) (2024-03-20) -[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.1-pre2...v1.2.2-pre1) +[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.1-pre2...v1.2.3) **Merged pull requests:** @@ -230,19 +238,19 @@ ## [v1.1.7-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.1.7-pre1) (2024-02-14) -[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.7...v1.1.7-pre1) +[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.6-pre1...v1.1.7-pre1) **Merged pull requests:** - Command Line Validation of Indirect Signatures [\#78](https://github.com/microsoft/CoseSignTool/pull/78) ([elantiguamsft](https://github.com/elantiguamsft)) -## [v1.1.7](https://github.com/microsoft/CoseSignTool/tree/v1.1.7) (2024-02-07) +## [v1.1.6-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.1.6-pre1) (2024-02-07) -[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.6-pre1...v1.1.7) +[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.7...v1.1.6-pre1) -## [v1.1.6-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.1.6-pre1) (2024-02-07) +## [v1.1.7](https://github.com/microsoft/CoseSignTool/tree/v1.1.7) (2024-02-07) -[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.6...v1.1.6-pre1) +[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.6...v1.1.7) **Merged pull requests:** @@ -375,7 +383,7 @@ ## [v1.1.0-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.1.0-pre1) (2023-11-03) -[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v0.3.1-pre.10...v1.1.0-pre1) +[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.0...v1.1.0-pre1) **Merged pull requests:** @@ -385,13 +393,13 @@ - DetachedSignatureFactory accepts pre-hashed content as payload [\#53](https://github.com/microsoft/CoseSignTool/pull/53) ([elantiguamsft](https://github.com/elantiguamsft)) - Add password support for certificate files [\#52](https://github.com/microsoft/CoseSignTool/pull/52) ([lemccomb](https://github.com/lemccomb)) -## [v0.3.1-pre.10](https://github.com/microsoft/CoseSignTool/tree/v0.3.1-pre.10) (2023-10-10) +## [v1.1.0](https://github.com/microsoft/CoseSignTool/tree/v1.1.0) (2023-10-10) -[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.0...v0.3.1-pre.10) +[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v0.3.1-pre.10...v1.1.0) -## [v1.1.0](https://github.com/microsoft/CoseSignTool/tree/v1.1.0) (2023-10-10) +## [v0.3.1-pre.10](https://github.com/microsoft/CoseSignTool/tree/v0.3.1-pre.10) (2023-10-10) -[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v0.3.1-pre.9...v1.1.0) +[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v0.3.1-pre.9...v0.3.1-pre.10) **Merged pull requests:**