Skip to content

Conversation

frenchwr
Copy link
Member

This adds support for automatically detecting any snap components defined in a snap's snapcraft.yaml, and if found, uploading those components along with the snap to the store.

Side note: I updated from snap push to snap upload as the latter is now preferred and the former is being deprecated.

In parallel, I have asked the Snap Store team to grant permissions for snap components to be uploaded if published under snapcrafters.

Note I have tested the commands locally but have NOT tested from a GitHub action pointed at my fork. I can do so for testing a snap WITHOUT components, but do not have permissions in the store needed to test uploads for a snap with components.

@frenchwr frenchwr requested a review from jnsgruk July 22, 2025 20:34
Comment on lines +172 to +173
components: ${{ steps.snapcraft-yaml.outputs.components }}
name: ${{ steps.snapcraft-yaml.outputs.snap-name }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you kindly change the variables to upper snake case format? This will keep them consistent with the rest IMO.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do you see upper snake case used elsewhere?

From the Contributing section in the README:

Github Action inputs/outputs should be named all lowercase, separated by - where needed. The applies to inputs/outputs to actions themselves, and for individual steps within the actions. For example: snap-name or token.

Copy link
Member

@jnsgruk jnsgruk Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right for the action inputs, but I think your environment variable names need to be upoer case to match the others like SNAP_FILE

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind making the change, but this is not the pattern I see used in the repo, or even this file, for example here where the only environment variable that uses all upper case is a hard-coded string. It seems SNAP_FILE is the exception to the rule and maybe should have been lowercase for consistency with the rest of this file. SNAPCRAFT_STORE_CREDENTIALS is correct and follows this guidance from the README:

Environment variables referring to repository level secrets and variables should be named all uppercase, and separated by _. For example: SNAPCRAFTERS_BOT_COMMIT.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, right you are. Turns out I should read my own CONTRIBUTING doc 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We both made the same mistake.🥲

@frenchwr frenchwr requested a review from jnsgruk July 23, 2025 13:46
@jnsgruk jnsgruk merged commit 0a0351c into snapcrafters:main Jul 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants