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

Make it possible to create a GH release without publishing! #422

Open
trueberryless opened this issue Nov 14, 2024 · 6 comments
Open

Make it possible to create a GH release without publishing! #422

trueberryless opened this issue Nov 14, 2024 · 6 comments

Comments

@trueberryless
Copy link

Description

I'm currently struggling to create a nice CI flow because this action doesn't want to create a release when no publishing happens. I would love to use this action for versioning my website too, which unfortunately is no npm package and therefore things are very very complicated when I want to work with this action. But I love this approach and this action, so I'm gonna ask if it is possible to adapt the action, so it supports creating a release, even when no publishing happens. This would allow to create a custom GH action for deploying and this action handles the releases as soon as the deployment succeeds.

I was thinking of something like this: When the user specifically enables createGithubReleases, the action creates it as if a publish happend. I'm not sure how much of a refactor this would be for this action, but let's discuss possible solutions below!

release:
        name: Release
        needs: deployment
        runs-on: ubuntu-latest
        outputs:
            docs: ${{ steps.changesets.outputs.hasChangesets }}
        steps:
            - # ...
            - name: Create Release Pull Request
              id: changesets
              uses: changesets/action@v1
              with:
                  createGithubReleases: true
              env:
                  GITHUB_TOKEN: ${{ secrets.PUBLIC_GITHUB_TOKEN }}
                  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

Related Issue

changesets/changesets#849

@Nickersoft
Copy link

I'm interested in this as well! I feel like it should be fairly straightforward to add, so happy to open a PR if the maintainers think it's a good idea :) Also, I think maybe it would make more sense to either let publish be an optional arg, or have a skipPublish option in the config.

What I find odd is that this action literally uses regex to grep the output of your publish command to figure out the tags it should publish. I would think that seeing Changesets itself is a versioning tool, it should be able to just invoke a CLI command that would provide the latest version numbers. We might have to add that though, not sure.

@Sampm91
Copy link

Sampm91 commented Nov 16, 2024 via email

@Sampm91
Copy link

Sampm91 commented Nov 16, 2024 via email

@trueberryless
Copy link
Author

Also, I think maybe it would make more sense to either let publish be an optional arg, or have a skipPublish option in the config.

I think that the publish command is currently optional, however if it is not provided, the axtion assumes you don't want to publish which automatically means that you don't want to release anything. That's the problem...

@Nickersoft
Copy link

Ah you're right @trueberryless – in that case I would think your original intuition is probably correct. Explicitly setting a GitHub release flag would trigger a release regardless of whether publish is specified or not. Otherwise, I would think the createGitHubRelease flag default would only apply if publish is also being specified.

@trueberryless
Copy link
Author

Otherwise, I would think the createGitHubRelease flag default would only apply if publish is also being specified.

That is THE PERFECT SOLUTION in my mind, but we also have to think about the flaws: It's very unintuitive for newcomers and complicated to explain in documentation because different props kinda chnage the logic of each other without changing the other prop.

So maybe an additional prop would be more beneficial...

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

No branches or pull requests

3 participants