Skip to content

Commit

Permalink
fixup! feat(release-to-candidate): Support projects that doesn't spec…
Browse files Browse the repository at this point in the history
…ify the `version` property

Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
  • Loading branch information
brlin-tw committed Aug 23, 2024
1 parent 79b567a commit c923fd1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions release-to-candidate/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ runs:
# matching it via globbing
snaps=("${name}_"*"_${arch}.snap")
snap="${snaps[0]}"
snap_version_raw="${snap%_${arch}.snap}"
snap_version="${snap_version_raw#${name}_}"
fi
if [[ ! -e "${snap}" ]]; then
Expand All @@ -163,6 +165,9 @@ runs:
if [[ -n "$project_root" ]]; then
echo "snap=${project_root}/${snap}" >> "$GITHUB_OUTPUT"
fi
if [[ "$version" == null ]]; then
echo "version=${snap_version}" >> "$GITHUB_OUTPUT"
fi
echo "name: ${name}" >> "manifest-${{ inputs.architecture }}.yaml"
echo "architecture: ${arch}" >> "manifest-${{ inputs.architecture }}.yaml"
Expand Down Expand Up @@ -200,12 +205,17 @@ runs:
multi_snap: ${{ inputs.multi-snap }}
name: ${{ steps.snapcraft-yaml.outputs.snap-name }}
version: ${{ steps.snapcraft-yaml.outputs.version }}
build_version: ${{ steps.build.outputs.version }}
run: |
git config --global user.name "${{ inputs.bot-name }}"
git config --global user.email "${{ inputs.bot-email }}"
revision="${{ steps.publish.outputs.revision }}"
if [[ "${version}" == null ]]; then
version="${build_version}"
fi
if [[ "${multi_snap}" == "true" ]]; then
tag_name="${name}-${version}/rev${revision}/${{ inputs.architecture }}"
else
Expand Down

0 comments on commit c923fd1

Please sign in to comment.