Skip to content

Commit

Permalink
experiment (#104)
Browse files Browse the repository at this point in the history
* experiment

* tweak

* kill bad tag

* test values

* kill coments

* spacing

* loop instead of range

* remove brackets

* check outputs

* Update changelog for release

* bigger range

* no quotes

* moreadata

* --list  --sort=version:refname

* no sort

* fetch first

* restore sort order and variables

* try inline filter

* pipe outside command

* awk

* awk

* short awk syntax

* trim dead code

* check array output

* validate env output

* longform awk

* remove brackets

* remove tr

* try other receiving syntax

* del env line

* add action

* validate nested for loop

* Trya adding a blank line

* Move script to release job

* build from csproj instead of sln

* Get rid of --no-build

---------

Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
lemccomb and actions-user authored Aug 23, 2024
1 parent 4227ef0 commit bbdac24
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 77 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
dir_command: ls -a -R
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
Expand All @@ -48,15 +48,14 @@ 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.
# TODO: Remove the dotnet publish commands once we know they work.
- name: Build and Test debug
run: |
dotnet build --configuration Debug CoseSignTool.sln
dotnet test CoseSign1.Tests/CoseSign1.Tests.csproj
dotnet test CoseSign1.Certificates.Tests/CoseSign1.Certificates.Tests.csproj
dotnet test CoseIndirectSignature.Tests/CoseIndirectSignature.Tests.csproj
dotnet test CoseHandler.Tests/CoseHandler.Tests.csproj
dotnet test CoseSignTool.Tests/CoseSignTool.Tests.csproj --verbosity detailed
dotnet test --no-restore CoseSign1.Tests/CoseSign1.Tests.csproj
dotnet test --no-restore CoseSign1.Certificates.Tests/CoseSign1.Certificates.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
# List the contents of the working directory to make sure all the artifacts are there.
- name: List working directory
Expand Down
52 changes: 12 additions & 40 deletions .github/workflows/rerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,69 +44,41 @@ jobs:
zip_command_release: zip -r CoseSignTool-MacOS-release.zip ./release/

steps:
# Checkout the branch.
- name: Checkout repository
uses: actions/checkout@v4

- name: Get list of tags
run: |
oldest=${{ github.event.inputs.oldest }}
newest=${{ github.event.inputs.newest }}
tags=$(git tag --sort=creatordate "$oldest".."$newest")
echo "tagsToUpdate=[$(echo $tags | tr ' ' ',')]" >> $GITHUB_ENV
git fetch --quiet
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
- name: Release assets for selected tags
run: |
git fetch --tags
for tag in ${{ env.tagsToUpdate }}; do
echo "**** Release $tag ****\n******************************\n"
# Run checkout action
echo "::group::Checkout"
echo "Checkout tagged release"
- name: Checkout tagged release
uses: actions/checkout@v4
with:
ref: $tag
echo "::endgroup::"
# Build and publish the binaries to ./published.
echo "::group::Publish"
echo "Build and publish"
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
# Self-contained is needed. Must use .csproj instead of .sln.
echo "::endgroup::"
# Copy the docs, license, and markdown files to the release folders.
echo "::group::Copy"
echo "Copy documentation"
echo "**** Copy documentation for $tag ****"
for folder in debug release; do
mkdir -p published/$folder/docs
cp -r docs/* published/$folder/docs/
cp -r LICENSE published/$folder/
cp -r *.md published/$folder/
done
echo "::endgroup::"
# Create zip files for release.
echo "::group::Zips"
echo "Create zip files for the release"
echo "**** Create zip files for $tag ****"
${{ matrix.zip_command_debug }}
${{ matrix.zip_command_release }}
${{ matrix.dir_command }}
echo "::endgroup::"
# Upload the zipped assets to the release.
echo "::group::Upload"
echo "Upload .zip files to Github"
- name: Upload artifacts
id: upload
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./published/CoseSignTool-*.zip
file_glob: true
overwrite: true
tag: ${{ needs.create_release.outputs.tag_name }}
echo "::endgroup::"
echo "**** Upload zip files to GitHub ****"
gh release upload $tag ./published/CoseSignTool-*.zip
done
72 changes: 42 additions & 30 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [v1.2.7-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.2.7-pre1) (2024-08-22)

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

**Merged pull requests:**

- Create rerelease.yml [\#103](https://github.com/microsoft/CoseSignTool/pull/103) ([lemccomb](https://github.com/lemccomb))

## [v1.2.7](https://github.com/microsoft/CoseSignTool/tree/v1.2.7) (2024-08-22)

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

## [v1.2.6-pre2](https://github.com/microsoft/CoseSignTool/tree/v1.2.6-pre2) (2024-08-22)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.6-pre1...v1.2.6-pre2)
Expand Down Expand Up @@ -38,19 +50,19 @@

## [v1.2.5-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.2.5-pre1) (2024-08-14)

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

**Merged pull requests:**

- Update package dependencies [\#99](https://github.com/microsoft/CoseSignTool/pull/99) ([lemccomb](https://github.com/lemccomb))

## [v1.2.4-pre3](https://github.com/microsoft/CoseSignTool/tree/v1.2.4-pre3) (2024-08-06)
## [v1.2.5](https://github.com/microsoft/CoseSignTool/tree/v1.2.5) (2024-08-06)

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

## [v1.2.5](https://github.com/microsoft/CoseSignTool/tree/v1.2.5) (2024-08-06)
## [v1.2.4-pre3](https://github.com/microsoft/CoseSignTool/tree/v1.2.4-pre3) (2024-08-06)

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

**Merged pull requests:**

Expand All @@ -66,19 +78,19 @@

## [v1.2.4-pre1](https://github.com/microsoft/CoseSignTool/tree/v1.2.4-pre1) (2024-07-15)

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

**Merged pull requests:**

- User/lemccomb/fileread [\#94](https://github.com/microsoft/CoseSignTool/pull/94) ([lemccomb](https://github.com/lemccomb))

## [v1.2.4](https://github.com/microsoft/CoseSignTool/tree/v1.2.4) (2024-06-14)
## [v1.2.3-pre7](https://github.com/microsoft/CoseSignTool/tree/v1.2.3-pre7) (2024-06-14)

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

## [v1.2.3-pre7](https://github.com/microsoft/CoseSignTool/tree/v1.2.3-pre7) (2024-06-14)
## [v1.2.4](https://github.com/microsoft/CoseSignTool/tree/v1.2.4) (2024-06-14)

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

**Merged pull requests:**

Expand Down Expand Up @@ -138,7 +150,7 @@

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

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

**Closed issues:**

Expand All @@ -148,13 +160,13 @@

- more granular error codes [\#86](https://github.com/microsoft/CoseSignTool/pull/86) ([lemccomb](https://github.com/lemccomb))

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

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

## [v1.2.2](https://github.com/microsoft/CoseSignTool/tree/v1.2.2) (2024-03-12)
## [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.2)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.2.1...v1.2.1-pre1)

**Merged pull requests:**

Expand All @@ -174,15 +186,15 @@

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

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

## [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.2.0...v1.1.8-pre1)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.8-pre1...v1.2.0)

## [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...v1.2.0)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.8...v1.1.8-pre1)

**Merged pull requests:**

Expand Down Expand Up @@ -210,19 +222,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.6-pre1...v1.1.7-pre1)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.7...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.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.7...v1.1.6-pre1)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.6-pre1...v1.1.7)

## [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...v1.1.7)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.6...v1.1.6-pre1)

**Merged pull requests:**

Expand Down Expand Up @@ -286,19 +298,19 @@

## [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.1...v1.1.1-pre1)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.0-pre7...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.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-pre7...v1.1.1)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.1...v1.1.0-pre7)

## [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.0-pre6...v1.1.0-pre7)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v1.1.0-pre6...v1.1.1)

**Closed issues:**

Expand Down
1 change: 1 addition & 0 deletions CoseSignTool.sln
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{
.github\workflows\dependency-review.yml = .github\workflows\dependency-review.yml
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
.github\workflows\OpenPR.yml = .github\workflows\OpenPR.yml
.github\workflows\rerelease.yml = .github\workflows\rerelease.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoseSign1.Headers", "CoseSign1.Headers\CoseSign1.Headers.csproj", "{DE822040-D5AB-41C8-83B2-4938FF00C7E5}"
Expand Down

0 comments on commit bbdac24

Please sign in to comment.