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

Adapt workflow to build from a specific tag #80

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

GuillaumeBourque-QC
Copy link
Contributor

This is the new version with the signature on the commit

@GuillaumeBourque-QC GuillaumeBourque-QC mentioned this pull request Oct 18, 2024
Copy link
Member

@WadeBarnes WadeBarnes left a comment

Choose a reason for hiding this comment

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

I still think it would be better and easier to build from a release rather than a tag. The release process tags anyway and the release and would trigger the build with the appropriate metadata.

The way the workflow is setup now it will always try to find the latest tag whenever code is pushed to the main branch. The latest commit is not guaranteed to be tagged, so the build could be rebuilding the same tagged code over and over for a long time until a new tag is pushed.

The examples I provided in #78 show the steps needed to build off a release. They are a bit more complicated then needed for this project so the process could be simplified.

Comment on lines 52 to 71
- name: Extract latest version from Git tag, excludind the v.
run: |
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1` | cut -c2-)
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
echo "LATEST_TAG=$LATEST_TAG"

- name: Checkout repository specific tag
uses: actions/checkout@v4
with:
ref: v${{ inputs.ref || env.LATEST_TAG }}

- name: Log in to the GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set lowercase username
run: echo "USERNAME=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
Copy link
Member

Choose a reason for hiding this comment

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

This whole section of code seems to be duplicated.

Copy link
Contributor Author

@GuillaumeBourque-QC GuillaumeBourque-QC Oct 21, 2024

Choose a reason for hiding this comment

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

Yes if we go the TAG way we first need to checkout de main code and then get the latest TAG from the code and then we can checkout the correct version for the build.

Since we limit the change to the fetch-valdator-status path the build will not be launch very often but going with the release make sense.

Right now I am asinged on a new task in Sylvain team, but if you want to go the relaese way that would be a good way forward, but I will have limited bandwith for the next few weeks.

Best.

Signed-off-by: GuillaumeBourque-QC <[email protected]>
Signed-off-by: GuillaumeBourque-QC <[email protected]>
Signed-off-by: GuillaumeBourque-QC <[email protected]>
@GuillaumeBourque-QC
Copy link
Contributor Author

Hello @WadeBarnes check the latest version which will build when ever a new version is release.

let me know.

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.

2 participants