-
Notifications
You must be signed in to change notification settings - Fork 27
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
base: main
Are you sure you want to change the base?
Adapt workflow to build from a specific tag #80
Conversation
Signed-off-by: GuillaumeBourque-QC <guillaume.bourque-ext@mcn.gouv.qc.ca>
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 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.
- 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 |
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.
This whole section of code seems to be duplicated.
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.
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 <guillaume.bourque-ext@mcn.gouv.qc.ca>
Signed-off-by: GuillaumeBourque-QC <guillaume.bourque-ext@mcn.gouv.qc.ca>
Signed-off-by: GuillaumeBourque-QC <guillaume.bourque-ext@mcn.gouv.qc.ca>
Hello @WadeBarnes check the latest version which will build when ever a new version is release. let me know. |
This is the new version with the signature on the commit