Skip to content

Commit

Permalink
Set file versions in release workflow (#120)
Browse files Browse the repository at this point in the history
* Set file versions in release workflow

* Update changelog for release

* make the function testable from PR

* don't wait for create_release

* fix path to proj files

* move the exit point so I can see outputs

* allow publish

* Update changelog for release

* verify file write in code

* clarity of result

* production ready

* try using -p: to set version

* $VERSION

* simplify

* no vars

* path

* check publish

* the .

* set working dir

* get-item

* paths

* dll

* kill parens

* tweak

* $

* test publish early

* try publish early and dotnet exec to read version

Signed-off-by: lemccomb <[email protected]>

* remove additional probing path

Signed-off-by: lemccomb <[email protected]>

* try another PS syntax

Signed-off-by: lemccomb <[email protected]>

* fix ps version

Signed-off-by: lemccomb <[email protected]>

* file path

Signed-off-by: lemccomb <[email protected]>

* validate call syntax

Signed-off-by: lemccomb <[email protected]>

* get rid of exit

Signed-off-by: lemccomb <[email protected]>

* alternate syntax

Signed-off-by: lemccomb <[email protected]>

* cleanup

Signed-off-by: lemccomb <[email protected]>

* remove hard-coded file version

Signed-off-by: lemccomb <[email protected]>

* remove hard-coded file version

Signed-off-by: lemccomb <[email protected]>

* remove hard-coded file version

Signed-off-by: lemccomb <[email protected]>

* remove hard-coded file version

Signed-off-by: lemccomb <[email protected]>

* remove hard-coded file version

Signed-off-by: lemccomb <[email protected]>

* remove hard-coded file version

Signed-off-by: lemccomb <[email protected]>

* remove hard-coded file version

Signed-off-by: lemccomb <[email protected]>

* remove exit

Signed-off-by: lemccomb <[email protected]>

---------

Signed-off-by: lemccomb <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
lemccomb and actions-user authored Nov 20, 2024
1 parent 38695e2 commit 7238bae
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 43 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,16 @@ jobs:
# Use the Dotnet Test command to load dependencies, build, and test the code.
# We have to run the test projects individually so CoseSignTool.Tests can run under arm64 on the Mac runner.
- name: Build and Test debug
id: build-test
run: |
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
dotnet test --no-restore CoseSignTool.Tests/CoseSignTool.Tests.csproj
# List the contents of the working directory to make sure all the artifacts are there.
- name: List working directory
run: ${{ matrix.dir_command }}
Expand All @@ -80,7 +81,7 @@ jobs:
- name: Checkout code
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v2

# Sync the changelog version.
- name: Fetch and checkout
if: ${{ github.event_name == 'pull_request' }}
Expand Down Expand Up @@ -273,9 +274,24 @@ jobs:
# Build and publish the binaries to ./published.
- name: Publish outputs
run: |
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
VERSION=${{ needs.create_release.outputs.tag_name }}
dotnet publish --configuration Debug --self-contained true --output published/debug --property:FileVersion=$VERSION CoseSignTool/CoseSignTool.csproj
dotnet publish --configuration Release --self-contained true --output published/release --property:FileVersion=$VERSION CoseSignTool/CoseSignTool.csproj
# Self-contained is needed. Must use .csproj instead of .sln.
# List the contents of the published directory to make sure all the artifacts are there.
- name: List published directory
run: ${{ matrix.dir_command }}
working-directory: ./published

# Verify that the file versions on the DLLs match the release version
- name: Check File Version
run: |
$file = Get-Item "CoseSignTool.dll"
$version = $file.VersionInfo.FileVersion
Write-Output "File Version is $version"
shell: pwsh
working-directory: ./published/debug

# Copy the docs, license, and markdown files to the release folders.
- name: Copy docs to release folders
Expand Down
104 changes: 66 additions & 38 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## [v0.0.0-Test1](https://github.com/microsoft/CoseSignTool/tree/v0.0.0-Test1) (2024-10-30)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.8-pre7...v0.0.0-Test1)

## [v1.2.8-pre7](https://github.com/microsoft/CoseSignTool/tree/v1.2.8-pre7) (2024-10-30)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.3.0...v1.2.8-pre7)

**Closed issues:**

- Revocation and Root Trust [\#119](https://github.com/microsoft/CoseSignTool/issues/119)

**Merged pull requests:**

- Adds CLI install instructions [\#116](https://github.com/microsoft/CoseSignTool/pull/116) ([ivarprudnikov](https://github.com/ivarprudnikov))

## [v1.3.0](https://github.com/microsoft/CoseSignTool/tree/v1.3.0) (2024-10-30)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.8-pre6...v1.3.0)

## [v1.2.8-pre6](https://github.com/microsoft/CoseSignTool/tree/v1.2.8-pre6) (2024-10-30)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.8-pre5...v1.2.8-pre6)

**Merged pull requests:**

- .NET 8 Revocation and Root Trust Bugfix [\#118](https://github.com/microsoft/CoseSignTool/pull/118) ([elantiguamsft](https://github.com/elantiguamsft))

## [v1.2.8-pre5](https://github.com/microsoft/CoseSignTool/tree/v1.2.8-pre5) (2024-10-21)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.8-pre4...v1.2.8-pre5)
Expand All @@ -18,19 +46,19 @@

## [v1.2.8-pre3](https://github.com/microsoft/CoseSignTool/tree/v1.2.8-pre3) (2024-10-15)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.8-pre2...v1.2.8-pre3)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.8-pre1...v1.2.8-pre3)

**Merged pull requests:**

- Increase timeout for checking for empty streams [\#113](https://github.com/microsoft/CoseSignTool/pull/113) ([lemccomb](https://github.com/lemccomb))

## [v1.2.8-pre2](https://github.com/microsoft/CoseSignTool/tree/v1.2.8-pre2) (2024-09-25)
## [v1.2.8-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.2.8-pre1) (2024-09-25)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.8-pre1...v1.2.8-pre2)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.8-pre2...v1.2.8-pre1)

## [v1.2.8-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.2.8-pre1) (2024-09-25)
## [v1.2.8-pre2](https://github.com/microsoft/CoseSignTool/tree/v1.2.8-pre2) (2024-09-25)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.8...v1.2.8-pre1)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.8...v1.2.8-pre2)

**Merged pull requests:**

Expand Down Expand Up @@ -196,47 +224,47 @@

## [v1.2.1-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.2.1-pre1) (2024-03-12)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.1...v1.2.1-pre1)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.0-pre1...v1.2.1-pre1)

**Merged pull requests:**

- Revert "Add .exe to CoseSignTool NuGet" [\#83](https://github.com/microsoft/CoseSignTool/pull/83) ([elantiguamsft](https://github.com/elantiguamsft))

## [v1.2.1](https://github.com/microsoft/CoseSignTool/tree/v1.2.1) (2024-03-07)
## [v1.2.0-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.2.0-pre1) (2024-03-07)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.0-pre1...v1.2.1)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.1...v1.2.0-pre1)

## [v1.2.0-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.2.0-pre1) (2024-03-07)
## [v1.2.1](https://github.com/microsoft/CoseSignTool/tree/v1.2.1) (2024-03-07)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.exeTest...v1.2.0-pre1)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.exeTest...v1.2.1)

**Merged pull requests:**

- Add .exe to CoseSignTool NuGet [\#81](https://github.com/microsoft/CoseSignTool/pull/81) ([elantiguamsft](https://github.com/elantiguamsft))

## [v1.2.exeTest](https://github.com/microsoft/CoseSignTool/tree/v1.2.exeTest) (2024-03-06)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.0...v1.2.exeTest)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.8-pre1...v1.2.exeTest)

## [v1.2.0](https://github.com/microsoft/CoseSignTool/tree/v1.2.0) (2024-03-04)
## [v1.1.8-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.1.8-pre1) (2024-03-04)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.8-pre1...v1.2.0)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.0...v1.1.8-pre1)

## [v1.1.8-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.1.8-pre1) (2024-03-04)
## [v1.2.0](https://github.com/microsoft/CoseSignTool/tree/v1.2.0) (2024-03-04)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.7-pre3...v1.1.8-pre1)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.8...v1.2.0)

**Merged pull requests:**

- Update Nuspec for CoseIndirectSignature [\#80](https://github.com/microsoft/CoseSignTool/pull/80) ([elantiguamsft](https://github.com/elantiguamsft))

## [v1.1.7-pre3](https://github.com/microsoft/CoseSignTool/tree/v1.1.7-pre3) (2024-03-02)
## [v1.1.8](https://github.com/microsoft/CoseSignTool/tree/v1.1.8) (2024-03-02)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.8...v1.1.7-pre3)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.7-pre3...v1.1.8)

## [v1.1.8](https://github.com/microsoft/CoseSignTool/tree/v1.1.8) (2024-03-02)
## [v1.1.7-pre3](https://github.com/microsoft/CoseSignTool/tree/v1.1.7-pre3) (2024-03-02)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.7-pre2...v1.1.8)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.7-pre2...v1.1.7-pre3)

**Merged pull requests:**

Expand Down Expand Up @@ -308,39 +336,39 @@

## [v1.1.3](https://github.com/microsoft/CoseSignTool/tree/v1.1.3) (2024-01-24)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.2...v1.1.3)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.1-pre2...v1.1.3)

**Merged pull requests:**

- Updating snk for internal package compatibility [\#72](https://github.com/microsoft/CoseSignTool/pull/72) ([elantiguamsft](https://github.com/elantiguamsft))

## [v1.1.2](https://github.com/microsoft/CoseSignTool/tree/v1.1.2) (2024-01-18)
## [v1.1.1-pre2](https://github.com/microsoft/CoseSignTool/tree/v1.1.1-pre2) (2024-01-18)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.1-pre2...v1.1.2)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.2...v1.1.1-pre2)

## [v1.1.1-pre2](https://github.com/microsoft/CoseSignTool/tree/v1.1.1-pre2) (2024-01-18)
## [v1.1.2](https://github.com/microsoft/CoseSignTool/tree/v1.1.2) (2024-01-18)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.1-pre1...v1.1.1-pre2)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.1-pre1...v1.1.2)

**Merged pull requests:**

- Add logging for failure paths as well as some various improvements to the code base. [\#71](https://github.com/microsoft/CoseSignTool/pull/71) ([JeromySt](https://github.com/JeromySt))

## [v1.1.1-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.1.1-pre1) (2024-01-17)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.0-pre7...v1.1.1-pre1)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.1...v1.1.1-pre1)

**Merged pull requests:**

- Move CreateChangelog to after build in PR build [\#70](https://github.com/microsoft/CoseSignTool/pull/70) ([lemccomb](https://github.com/lemccomb))

## [v1.1.0-pre7](https://github.com/microsoft/CoseSignTool/tree/v1.1.0-pre7) (2024-01-12)
## [v1.1.1](https://github.com/microsoft/CoseSignTool/tree/v1.1.1) (2024-01-12)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.1...v1.1.0-pre7)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.0-pre7...v1.1.1)

## [v1.1.1](https://github.com/microsoft/CoseSignTool/tree/v1.1.1) (2024-01-12)
## [v1.1.0-pre7](https://github.com/microsoft/CoseSignTool/tree/v1.1.0-pre7) (2024-01-12)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.0-pre6...v1.1.1)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.0-pre6...v1.1.0-pre7)

**Closed issues:**

Expand Down Expand Up @@ -397,7 +425,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:**

Expand All @@ -407,13 +435,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.2...v0.3.1-pre.10)

**Merged pull requests:**

Expand All @@ -423,13 +451,13 @@
- Port changes from ADO repo to GitHub repo [\#46](https://github.com/microsoft/CoseSignTool/pull/46) ([lemccomb](https://github.com/lemccomb))
- Re-enable CodeQL [\#45](https://github.com/microsoft/CoseSignTool/pull/45) ([lemccomb](https://github.com/lemccomb))

## [v0.3.1-pre.9](https://github.com/microsoft/CoseSignTool/tree/v0.3.1-pre.9) (2023-09-28)
## [v0.3.2](https://github.com/microsoft/CoseSignTool/tree/v0.3.2) (2023-09-28)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v0.3.2...v0.3.1-pre.9)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v0.3.1-pre.9...v0.3.2)

## [v0.3.2](https://github.com/microsoft/CoseSignTool/tree/v0.3.2) (2023-09-28)
## [v0.3.1-pre.9](https://github.com/microsoft/CoseSignTool/tree/v0.3.1-pre.9) (2023-09-28)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v0.3.1-pre.8...v0.3.2)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v0.3.1-pre.8...v0.3.1-pre.9)

**Merged pull requests:**

Expand Down

0 comments on commit 7238bae

Please sign in to comment.