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

chore(npm): publish rc version for prereleases #528

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

favna
Copy link
Contributor

@favna favna commented Mar 3, 2024

Description

I wouldn't call myself a Bash legend but I think this does the trick. FWIW I tested it using a Bash session, but I can't say for 100% certain the "" wrapping around the injected value from the GitHub workflow steps is correct, or if GitHub now adds double double quotes (as in if [ ""true"" = "true" ]).

As for the change on line 252, that's mostly just cleaned and moved to package.json.tmpl. Note that the binaries cannot be published with yarn npm publish because that package.json doesn't reside in a yarn configured folder and we probably don't want that anyway.

I looked at the history for npm/git-cliff/package.json and found this commit: 4218043#diff-09031284f88e0ed62cdbc8693d473bf5b8b9c5674257763d8d8ca0cebfc87a44. I see that you manually set the version to an rc version and I assume this commit then triggered this workflow so that should make it all work.

Motivation and Context

Requested in this comment: #514 (comment)

How Has This Been Tested?

I tested the individual steps using a Bash terminal session locally:

image

Screenshots / Logs (if applicable)

N.A.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other: Continuous delivery

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly. N.A.
  • I have formatted the code with rustfmt. N.A.
  • I checked the lints with clippy. N.A.
  • I have added tests to cover my changes. N.A.
  • All new and existing tests passed. N.A.

@favna favna requested a review from orhun as a code owner March 3, 2024 22:30
@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.14%. Comparing base (d768962) to head (cf4c6d4).
Report is 2 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #528   +/-   ##
=======================================
  Coverage   41.14%   41.14%           
=======================================
  Files          15       15           
  Lines        1038     1038           
=======================================
  Hits          427      427           
  Misses        611      611           
Flag Coverage Δ
unit-tests 41.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.github/workflows/cd.yml Outdated Show resolved Hide resolved
@favna
Copy link
Contributor Author

favna commented Mar 4, 2024

I'll be honest I didn't know you could use that syntax within a bash block lol

image
image

      - name: Testing
        shell: bash
        run: |
          echo ${{ github.ref }}
          echo ${{ contains(github.ref, '-') }}
          if [ ${{ contains(github.ref, '-') }} = "true" ]; then
            echo "This is a prerelease"
          else
            echo "This is a release"
          fi

Copy link
Owner

@orhun orhun left a comment

Choose a reason for hiding this comment

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

LGTM!

@orhun orhun changed the title ci: publish rc version with rc dist-tags chore(npm): publish rc version for prereleases Mar 5, 2024
@orhun orhun merged commit 16bea51 into orhun:main Mar 5, 2024
44 checks passed
@orhun
Copy link
Owner

orhun commented Mar 24, 2024

Hey @favna, I just created a RC version, but the NPM step failed: https://github.com/orhun/git-cliff/actions/runs/8412062961/job/23032878338

Was wondering if you have any about this 🤔

@favna
Copy link
Contributor Author

favna commented Mar 24, 2024

Woops, my bad. Created #574 that will fix that.

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