Skip to content

Commit

Permalink
Fix publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hudson-newey committed Oct 14, 2024
1 parent ddcf3f1 commit c8c6792
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ jobs:
shell: pwsh
run: ./scripts/build_docker.ps1
-github_actor '${{ github.actor }}'
-release_tag '${{ inputs.release_tag }}${{ github.event.inputs.release_tag }}'
-release_tag '${{ inputs.release_tag }}'
21 changes: 15 additions & 6 deletions scripts/version.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ param(
[string]
$release_tag
)

. $PSScriptRoot/exec.ps1

$now = Get-Date
Expand All @@ -17,16 +17,25 @@ $minor = $now.ToString("MM")
$patch = $now.ToString("dd")
$describe = exec { git describe --long --always }
$parts = $describe.split('-')
$height = [int]$parts[-2]
$height = 0
$unique_hash = $parts[-1].Trim('g')
$full_hash = exec { git rev-parse --verify HEAD }

$version = "$major.$minor.$patch"

# add build number if this is not the first tag with this version
$pre_release = ""
if ((git tag -l $version) -and ($height -gt 0)) {
$pre_release = "-build$height"
Write-Output "Checking if tag exists $describe"
if (git tag -l $version) {
# because we use the date for the version, we can have multiple versions
# with the same name
# to fix this we add a "build" number to the version if a build tag of the
# same version already exists
# we keep incrementing the build number until we find the next build number
# that has not been used
while (git tag -l "$version-build$height") {
$height++
}
$pre_release = "-build$height"
}

# build must be metadata only, can't alter version meaning
Expand All @@ -45,4 +54,4 @@ return [PSCustomObject]@{
DescribeVersion = "${version}${pre_release}+${build}"
# Calender version including pre-release and build
DockerTag = "${version}${pre_release}_${build}"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[id]="spectrogramId"
[src]="annotation.audioLink"
scaling="stretch"
color-map="audacity"
color-map="grayscale"
class="spectrogram"
></oe-spectrogram>
</oe-indicator>
Expand Down

0 comments on commit c8c6792

Please sign in to comment.