Skip to content

Move repo to work with a Makefile#667

Merged
joncinque merged 32 commits intosolana-program:mainfrom
joncinque:makefile
Aug 26, 2025
Merged

Move repo to work with a Makefile#667
joncinque merged 32 commits intosolana-program:mainfrom
joncinque:makefile

Conversation

@joncinque
Copy link
Copy Markdown
Contributor

@joncinque joncinque commented Aug 21, 2025

Problem

The program repos are getting a little out of hand, with many different methods of managing CI, scripts, etc etc.

Summary of changes

Token-2022 is the most complicated repo, with many different clients, multiple programs, and sub-libraries, so if we can get it to work here, it should be usable in all the other program repos.

  • Create a Makefile, similar to the system repo, to handle all jobs
  • Convert publish scripts to bash, similar to the system repo again
  • Remove js scripts that aren't related to Codama generation
  • Update the main CI and publish jobs to use Makefile commands
  • Use matrices in CI to simplify job construction (note it's a little goofy because you don't have access to env in the strategy context)
  • Use a reusable job for setting up the job: Add a reusable setup action actions#3

The biggest issue is that Makefile targets can't contain slashes, so we need to have some mapping between something like clients-rust-legacy to clients/rust-legacy. Rather than specify that mapping by hand, I opted to assume that the first word in a target is a subdirectory. This means we have to change confidential-transfer to confidential in the repo.

NOTE: Leaving this in draft, since I imagine it'll take some time to work Finally ready to take this out of draft! There are some goofy workarounds based on Make and GitHub Actions limitations, but I hope it'll be easy to apply to all the program repos by copying over the Makefile, scripts/ directory, and workflow files.

The only parts that will need to be customized by individual repos are the packages in the workflow files (main.yml, publish-rust.yml, and publish-js.yml) and the programs to add during restart-test-validator.sh.

#### Problem

The program repos are getting a little out of hand, with many different
methods of managing CI, scripts, etc etc.

#### Summary of changes

Token-2022 is the most complicated repo, with many different clients,
multiple programs, and sub-libraries, so if we can get it to work here,
it should be usable in all the other program repos.

* Create a Makefile, similar to the system repo, to handle all jobs
* Convert publish scripts to bash, similar to the system repo again
* Remove js scripts that aren't related to Codama generation
* Update the main CI and publish jobs to use Makefile commands
* Use matrices in CI to simplify job construction

The biggest issue is that Makefile targets can't contain slashes, so we
need to have some mapping between something like `clients-rust-legacy`
to `clients/rust-legacy`. Rather than specify that mapping by hand, I
opted to assume that the first word in a target is a subdirectory. This
means we have to change `confidential-transfer` to `confidential` in the
repo.
@joncinque joncinque marked this pull request as ready for review August 22, 2025 13:25
@joncinque
Copy link
Copy Markdown
Contributor Author

Ok this should be ready to go!

@joncinque
Copy link
Copy Markdown
Contributor Author

I forgot about another change that was needed during publish, which is only running the semver job on lib targets: 4835c9f

@joncinque joncinque merged commit 3986e68 into solana-program:main Aug 26, 2025
31 checks passed
@joncinque joncinque deleted the makefile branch August 26, 2025 10:24
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