-
Notifications
You must be signed in to change notification settings - Fork 6
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
workflows: Add automatic release action on file change #13
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks quite good. Just tests seem to fail and I left a comment on the syncing.
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git add version.py | ||
git commit -m "release: $NEW_VERSION" | ||
git push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Major: I believe you are missing to create the tag as well or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repo is quite outdate, we need first to upgrade it by moving from setup.py to setup.cfg and other fixed. Then we can rebase this PR on top.
- name: Keepalive check | ||
uses: gautamkrishnar/keepalive-workflow@v1 | ||
with: | ||
gh_token: ${{ secrets.INVENIOBOT_PAT }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this variable does not exist in this repo, isn't it?
Can you point us how to create that secret? Any doc from the action's creator?
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uses: actions/checkout@v3 | |
uses: actions/checkout@v4 |
|
||
- name: Check for changes | ||
run: | | ||
git diff --quiet || echo "changes_detected=true" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this diffing the entire repo files? Shouldn't we diff only the files in counter-robots/data
?
git diff --quiet || echo "changes_detected=true" >> $GITHUB_ENV | ||
continue-on-error: true | ||
|
||
- name: Commit if changes detected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not using an action instead? WDYT?
@@ -0,0 +1,36 @@ | |||
import datetime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not test it, but ChatGPT simply proposed to do it in the actions:
- name: Get current year and month
id: date
run: echo "year_month=$(date +'%Y.%m')" >> $GITHUB_ENV
- name: Update __version__ in __init__.py
run: |
sed -i "s/^__version__ = .*/__version__ = \"${{ env.year_month }}\"/" path/to/your/__init__.py
closes: #7