Closed SteveBush closed 3 years ago
I'm curious why you're filing this issue on this repo. The error comes from github in response to an operation executed by Nerdbank.GitVersioning, which this repo happens to consume. I haven't seen this error on this repo before. Can you file that over at Nerdbank.GitVersioning instead for triage?
Oh, I think I understand a bit more now. You've probably changed your instance of this template to enable this task on mac:
And then it fails. I'm not sure why. But the failure talks about an env var set by Nerdbank.GitVersioning. I suspect it may be a bug in github actions itself, or it might be nerdbank.gitversioning. But I'll reactivate here to investigate a bit more.
Sorry, I should have mentioned that I have enabled Build on macOS. I created the issue here because I wasn't sure if it was a problem with Nerdbank.GitVersioning, the template or GitHub Actions.
parameters:
- name: includeMacOS
displayName: Build on macOS
type: boolean
default: true # macOS is often bogged down in Azure Pipelines
Also, here's my version.json:
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "2.3-prerelease",
"publicReleaseRefSpec": [
"^refs/heads/main$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
]
}
Your includeMacOS
parameter snippet is specific to Azure Pipelines. Our GitHub Actions workflow file has nothing like that. It always runs on mac.
I just enabled more build steps on the mac github workflow in #117 and I don't repro the error you're seeing.
Can you please provide more context into your problem? Such as:
GitAssemblyInformationalVersio
(which is missing an n
). I also see in your env
listing that both n
and GitAssemblyInformationalVersion
(with an n!) are set. This suggests that both a failure and a success occurred.I should wait until I've had coffee to respond to issues. I should have included the Github build.yml.
Let me do some more investigation before I waste more of your time. Given your investigations above, it seems likely this is a problem with my Mac build on GitHub Actions (mac build on Azure Pipelines works fine) and not a general problem with the template or Nerdbank.GitVersioning.
I will also merge #117 into my repository. Thanks again.
I finally had some bandwidth to dig into this further. On Mac, creating an environment variable using >> corrupted the $GITHUB_ENV file. I believe this is a UTF8 issue. I changed to using PowerShell to append to the file with utf8 encoding and everything works fine.
FYI. I use the build configuration of Release-MacOS to determine which projects are built on the MacOS pipeline host. Similar for Linux, and Windows. I had create per host build configurations so I could build mobile apps (IOS, MacCatalyst, Android, WinUI) on a compatible agent/runner.
- name: Set build configuration on Mac
run: |
OLD: echo "BUILDCONFIGURATION=Release-MacOS" >> $GITHUB_ENV
NEW: echo "BUILDCONFIGURATION=Release-MacOS" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
if: runner.os == 'macOS'
On GitHub Actions, a build running on the Mac agent fails because it cannot process the GitAssemblyInformationalVersion environment variable.
Below is an example of the error and env: output.