Skip to content

gh-430: fix for release action#429

Merged
ntessore merged 1 commit intomainfrom
fix-release
Nov 15, 2024
Merged

gh-430: fix for release action#429
ntessore merged 1 commit intomainfrom
fix-release

Conversation

@ntessore
Copy link
Collaborator

@ntessore ntessore commented Nov 15, 2024

This should fix the release action. The git tag is stored into the environment after the README.md is made dirty, where setuptools-scm picks it up as the current version.

Closes: #430

@ntessore ntessore changed the title fix for release action gh-430: fix for release action Nov 15, 2024
Copy link
Member

@Saransh-cpp Saransh-cpp left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this, @ntessore!

@ntessore ntessore enabled auto-merge (squash) November 15, 2024 20:39
@ntessore ntessore disabled auto-merge November 15, 2024 20:39
@ntessore ntessore added the releases Related to packaging & releasing GLASS label Nov 15, 2024
@ntessore ntessore merged commit f84a307 into main Nov 15, 2024
@ntessore ntessore deleted the fix-release branch November 15, 2024 21:00
@paddyroddy
Copy link
Member

paddyroddy commented Nov 18, 2024

Good spot @ntessore. I'd overlook this 🤔. Your approach is nice and simple.

We could actually fix the "dirty" checkout by doing something like this

- name: Update version references
  run: |-
    # store the release tag
    tag="${{ github.ref_name }}"
    
    # regex patterns
    badge_pattern="s#(readthedocs\.org/projects/glass/badge/\?version=)stable#\1${tag}#g"
    url_pattern="s#(glass\.readthedocs\.io.*?)/stable#\1/${tag}#g"
    
    # perform the replacements
    sed --in-place --regexp-extended \
      --expression "$badge_pattern" \
      --expression "$url_pattern" \
      ${{ github.workspace }}/README.md
      
- name: Upload modified README
  uses: actions/upload-artifact@v3
  with:
    name: modified-readme
    path: README.modified

And downloading the README.modified as README.md in a subsequent step. What do you think?

@paddyroddy paddyroddy mentioned this pull request Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases Related to packaging & releasing GLASS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Releases get wrong version due to README rewriting

3 participants