Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github Action: Add version and version format check. #335

Merged
merged 17 commits into from
Jun 23, 2023
Merged
13 changes: 12 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
GH_TOKEN: ${{ github.token }}
shell: pwsh
run: |
if ( -Not ( $env:RELEASE_TAG -match '^v3\.[0-9]+\.[0-9]+(-preview)*$' ) ){
DannyDaoBoYang marked this conversation as resolved.
Show resolved Hide resolved
echo "Tag name format incorrect"
exit(1)
DannyDaoBoYang marked this conversation as resolved.
Show resolved Hide resolved
}
if ($env:PRERELEASE -eq 'true') {
$releaseUrl = gh release create "$env:RELEASE_TAG" --repo Brightspace/bmx --draft --prerelease --generate-notes --title "Release $env:RELEASE_TAG"
} else {
Expand Down Expand Up @@ -73,9 +77,16 @@ jobs:

- name: publish
shell: pwsh
env:
RELEASE_TAG: ${{ github.event.inputs.release_tag }}
working-directory: src/D2L.Bmx
run: |
dotnet publish -r $env:PLATFORM-x64 -o build
$version = "$env:RELEASE_TAG"
if ( -not $version -or $version -eq '' ){
DannyDaoBoYang marked this conversation as resolved.
Show resolved Hide resolved
$version = "v3.0.0"
}
$versionWithoutv = "$version".TrimStart("v")
dotnet publish /p:Version="$versionWithoutv" /p:InformationalVersion="$version" /p:IncludeSourceRevisionInInformationalVersion=false -r $env:PLATFORM-x64 -o build
DannyDaoBoYang marked this conversation as resolved.
Show resolved Hide resolved

- name: check size
shell: pwsh
Expand Down