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

workflows: Add automatic release action on file change #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sakshamarora1
Copy link
Contributor

closes: #7

Copy link

@jrcastro2 jrcastro2 left a 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

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?

Copy link

@ntarocco ntarocco left a 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 }}
Copy link

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
Copy link

Choose a reason for hiding this comment

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

Suggested change
uses: actions/checkout@v3
uses: actions/checkout@v4


- name: Check for changes
run: |
git diff --quiet || echo "changes_detected=true" >> $GITHUB_ENV
Copy link

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
Copy link

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
Copy link

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

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.

global: setup automatic updates and releases
3 participants