Skip to content

Commit

Permalink
Merge pull request #22 from microsoft/user/lemccomb/semver
Browse files Browse the repository at this point in the history
Test semver creation via git commands
  • Loading branch information
lemccomb authored Sep 25, 2023
2 parents 6a291d6 + 8945b91 commit 1678eae
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
36 changes: 35 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,29 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3

# - name: Create SemVer tag via Git
# id: semver-tag # Output: ${{ steps.semver-tag.outputs.semver_tag }}
# run: |
# echo "Add github/workspace to safe.directory."
# git config --global --add safe.directory /github/workspace
# git config --local user.email "action@github.com"
# git config --local user.name "GitHub Action"
# git fetch
# git checkout $GITHUB_HEAD_REF
# git branch --show-current
# echo "list tags"
# git tag
# echo "Get the latest tag."
# git tag --merged HEAD --sort=-creatordate | head -n 1
# #git describe --tags --abbrev=0
# #git describe --tags --abbrev=0 --match v[0-9]* --exclude main

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 7.0.x

# Use the Dotnet Test command to load dependencies, build, and test the code.
- name: Build and Test debug
run: dotnet test --verbosity normal CoseSignTool/CoseSignTool.sln
Expand Down Expand Up @@ -116,6 +135,14 @@ jobs:
# echo "::set-output name=generated_tag::$TAG"
# echo ::set-env name=TAG::$TAG
# Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

# Note: The semver-action doesn't work with the checkout action. It needs to be run in a separate step.
- name: Fetch and checkout
run:
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git fetch
git checkout $GITHUB_HEAD_REF

- name: Create SemVer tag # Maybe it will work now?
id: semver-tag # Output: ${{ steps.semver-tag.outputs.semver_tag }}
Expand All @@ -127,6 +154,13 @@ jobs:
bump: "patch"
debug: true

# - name: Create SemVer tag via Git
# id: semver-tag # Output: ${{ steps.semver-tag.outputs.semver_tag }}
# run: |
# git config --global --add safe.directory /github/workspace
# git rev-parse --is-inside-work-tree
# git describe --tags --abbrev=0 --match v[0-9]* --exclude main

- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Changelog

## [Unreleased](https://github.com/microsoft/CoseSignTool/tree/HEAD)
## [v0.0.1](https://github.com/microsoft/CoseSignTool/tree/v0.0.1) (2023-09-25)

[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v0.0.0-pre.1...HEAD)
[Full Changelog](https://github.com/microsoft/CoseSignTool/compare/v0.0.0-pre.1...v0.0.1)

**Merged pull requests:**

- Attempt to get semver step working again [\#21](https://github.com/microsoft/CoseSignTool/pull/21) ([lemccomb](https://github.com/lemccomb))
- move create\_changelog to before build [\#20](https://github.com/microsoft/CoseSignTool/pull/20) ([lemccomb](https://github.com/lemccomb))

## [v0.0.0-pre.1](https://github.com/microsoft/CoseSignTool/tree/v0.0.0-pre.1) (2023-09-08)
Expand Down

0 comments on commit 1678eae

Please sign in to comment.