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

updating ci pipeline #67

Closed
wants to merge 5 commits into from
Closed

Conversation

Juanito87
Copy link
Collaborator

This pr updates the ci pipeline to test and release using github workers for ubuntu 20 and 22.
Trgigers may be adjusted to something else that make more sense to the intended workflow.

@Juanito87 Juanito87 self-assigned this Oct 12, 2023
@danenbm danenbm requested review from febo and danenbm October 12, 2023 18:36
.github/workflows/test.yml Outdated Show resolved Hide resolved
Comment on lines +16 to +17
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the two OS matrix for releasing? We don't need it to run for both right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Those should be the 2 os more used, and 22 builds won't work on 20 and viceversa. If you think that releasing for 22 only is best, it's an easy fix.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok yes that makes sense for us to publish two. @febo and I reviewed it more closely and had some questions on how it works.

.github/workflows/release.yml Outdated Show resolved Hide resolved
Comment on lines -45 to -48
run: |
cargo publish -p plerkle_serialization --token $CARGO_TOKEN --no-verify || true
sleep 30
cargo publish -p plerkle_messenger --token $CARGO_TOKEN --no-verify || true
Copy link
Contributor

Choose a reason for hiding this comment

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

We still need these crate publishes I believe, and I don't see them in the new code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added back those lines

jobs:
release-stable:
runs-on: buildjet-8vcpu-ubuntu-2004
build20:
Copy link

Choose a reason for hiding this comment

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

Since the build20 job now has a "matrix" strategy, would this run twice (one for each OS) and therefore create 2 releases? Not sure if this is intentional.

Copy link
Collaborator Author

@Juanito87 Juanito87 Oct 12, 2023

Choose a reason for hiding this comment

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

It can be done on both ways, that's a thing you may decide, I can publish to one release, and rename things (that's the current workflow). Or I can publish to two different releses in the same workflow.
We can even run the workflows separatedly, but will duplicate the code.

- name: Build plerkle plugin
run: cargo build --verbose --release

- name: Package libplerkle
Copy link

Choose a reason for hiding this comment

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

This seems to run for both OS, while the next one only runs for ubuntu-22.04. Wonder if this is missing an if statement. Also, related to the "matrix" strategy, we might need just one of these, since it will run the whole job twice.

Copy link
Collaborator Author

@Juanito87 Juanito87 Oct 12, 2023

Choose a reason for hiding this comment

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

The idea of the job running in a matrix, is that it will execute the same code in each runner, but additionally, you can add task that will execute with the if statement, in a specific runner.
If you want to run the job only once, you need to define a single os version for the release.
Or you can have different releases in different jobs, or even files.
The way it's implemented here you have less duplicated code.

working-directory: target/release
run: tar -cvjf plerkle2222-x86_64-unknown-linux-gnu.tar.bz2 libplerkle.so

- name: Publish to release
Copy link

Choose a reason for hiding this comment

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

This probably will create 2 releases, one per OS. Perhaps this should move to a separate job that runs just once (without the "matrix" strategy) and uses the binaries built on the previous job.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should create a single release, with both binaries.
If it's clearer, or the wildcard doesn't resolve correctly, we can do 2 publish to release actions, with if statement, so each os version publish the specific artifact. This can publish to the same release or to two completely different ones.

@danenbm
Copy link
Contributor

danenbm commented Sep 6, 2024

Closing this as I think we have the pipeline fine now and this PR is old now. But in general, thank you for all your contributions and all the other PRs!!!

@danenbm danenbm closed this Sep 6, 2024
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.

3 participants