Skip to content

Commit

Permalink
feat: make inclusion of snap name in tag optional
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsgruk committed Apr 23, 2024
1 parent 67f20e2 commit 3357d26
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions release-to-candidate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
| `architecture` | The architecture for which to build the snap. | N | `amd64` |
| `channel` | The channel to release the snap to. | N | `latest/candidate` |
| `launchpad-token` | A token with permissions to create Launchpad remote builds. | Y | |
| `multi-snap` | Whether the repo contains the source for multiple snaps. | N | `false` |
| `repo-token` | A token with privileges to create and push tags to the repository. | Y |
| `snapcraft-project-root` | The path to the Snapcraft YAML file. | N | |
| `snapcraft-channel` | The channel to install Snapcraft from. | N | `latest/stable` |
Expand Down
11 changes: 10 additions & 1 deletion release-to-candidate/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ inputs:
launchpad-token:
description: "A token with permissions to create remote builds on Launchpad"
required: true
multi-snap:
description: "Whether the repo contains the source for multiple snaps"
required: false
default: "false"
repo-token:
required: true
description: A token with privileges to create and push tags to the repository.
Expand Down Expand Up @@ -136,7 +140,12 @@ runs:
git config --global user.email '[email protected]'
revision="${{ steps.publish.outputs.revision }}"
tag_name="${name}-${version}/rev${revision}/${{ inputs.architecture }}"
if [[ "${{ inputs.multi-snap }}" == "true" ]]; then
tag_name="${name}-${version}/rev${revision}/${{ inputs.architecture }}"
else
tag_name="${version}/rev${revision}/${{ inputs.architecture }}"
fi
git tag -a "$tag_name" -m "Revision ${revision}, released for ${{ inputs.architecture }}"
git push origin "$tag_name"

0 comments on commit 3357d26

Please sign in to comment.