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

Add build-and-publish-forc-binary CI job #1513

Merged
merged 2 commits into from
May 16, 2022

Conversation

ra0x3
Copy link
Contributor

@ra0x3 ra0x3 commented May 10, 2022

Description

  • This PR adds a build-and-publish-forc-binary CI job that uploads forc binaries for different architectures to a release, when the release is published
  • Binaries include:
    • forc
    • forc-fmt
    • forc-lsp
    • forc-explore

Testing Steps

To test a binary

  • Download the binary for your architecture (mine is darwin_amd64)
# Extract tar contents
tar -xvf forc-binaries-darwin_amd64.tar.gz

# Unzip the particular binary you want
gzip -d forc.darwin_amd64.gz

# Rename
mv forc.darwin_amd64 forc

# Update perms 
chmod 755 forc

# Use it
forc --help

# IMPORTANT: On Darwin architectures you might have to open 
# the executable with your terminal using the Finder app

You can view these test binaries over at https://github.com/FuelLabs/ci-dummy-test/releases/tag/v0.12.0

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@ra0x3 ra0x3 marked this pull request as draft May 11, 2022 20:01
@ra0x3 ra0x3 marked this pull request as ready for review May 12, 2022 18:39
@ra0x3 ra0x3 force-pushed the rashad/1191-add-forc-binaries-job-1 branch from 4593f43 to 51e9164 Compare May 12, 2022 18:53
Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

Good stuff! This only uploads forc, right? We need all forc* binaries though, including forc-fmt, forc-lsp, etc.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@ra0x3
Copy link
Contributor Author

ra0x3 commented May 13, 2022

@adlerjohn Whoops, thought those binaries would be made in separate PRs. I can add those as well in this PR

@ra0x3 ra0x3 marked this pull request as draft May 13, 2022 18:31
@ra0x3 ra0x3 marked this pull request as ready for review May 14, 2022 02:28
Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

Was this new change tested in the test repo? If not, I would like to see an example of it passing.

.github/workflows/ci.yml Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@ra0x3
Copy link
Contributor Author

ra0x3 commented May 14, 2022

Was this new change tested in the test repo? If not, I would like to see an example of it passing.

@adlerjohn Yea it was. I tested it last night. I cleaned up all the releases/tags in the test repo after I was finished but can go run it again

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@ra0x3
Copy link
Contributor Author

ra0x3 commented May 14, 2022

@adlerjohn Feel free to checkout the assets over at https://github.com/FuelLabs/ci-dummy-test/releases/tag/v0.12.0

@ra0x3 ra0x3 force-pushed the rashad/1191-add-forc-binaries-job-1 branch from 96ae6be to 1c32ee1 Compare May 15, 2022 02:32
.github/workflows/ci.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

Good stuff. This was the biggest blocker to having swayup/forcup! I'll defer to @JoshuaBatty and @mitchmindtree for final review.

Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

Last nit I swear 😂

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@ra0x3 ra0x3 force-pushed the rashad/1191-add-forc-binaries-job-1 branch from fa450f2 to e37c212 Compare May 15, 2022 19:23
@ra0x3 ra0x3 removed the request for review from JoshuaBatty May 15, 2022 19:24
@ra0x3 ra0x3 requested review from JoshuaBatty and mitchmindtree and removed request for mitchmindtree May 15, 2022 19:24
Copy link
Contributor

@mitchmindtree mitchmindtree left a comment

Choose a reason for hiding this comment

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

Awesome work @ra0x3, looking good to me!

uses: actions-rs/cargo@v1
with:
command: install
args: --profile=release --path ./forc
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
args: --profile=release --path ./forc
args: --path ./forc

--release is the default profile for the cargo install command (mentioned here) so could be removed from here and the following install invocations for the plugins, but I don't mind leaving it in for clarity - up to you!

Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

:shipit:

@ra0x3 ra0x3 merged commit 244be83 into master May 16, 2022
@ra0x3 ra0x3 deleted the rashad/1191-add-forc-binaries-job-1 branch May 16, 2022 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Setup CI to automatically publish forc binary for supported architectures under each release
4 participants