Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
86 lines (67 sloc) 4.15 KB

Open Sourcing

How we create and release new open source projects at Embark.

Release Steps

Setup New Repo

  1. Pick a name that isn't used on, also an emoji 💯
  2. Do the usual repo creation under the Embark org with the same name as the crate(s)
  3. Clone down the repo or else set it as the remote for an existing repo
  4. cargo new or init your repo if needed
  5. Do a cargo package and fixup any issues, normally this is stuff like missing the repository/docs/homepage etc metadata fields
  6. Do an initial publish of the crate with cargo publish --token <TOKEN> where TOKEN is and API token for the embark-studios user. This shared bot account allows us to publish all crates under the same user and not have to worry about managing owners.

Add CI

We mainly use Travis CI for all of our public code, but the general steps here would apply to whatever CI a repo decides to use.

It's recommended you use our Open Source Template when creating a new Rust Github repo, this already contains some basic CI templates and scripts to bootstrap your setup.

If you don't use the template, you can copy one of our existing repos that most closely matches your new repo.

The rest of this guide assumes you are using the CI setup from the Open Source Template.

  1. Rename rust.travis.yml to .travis.yml. We don't actually run real CI on our template repo!

  2. Add/remove steps as makes sense for the project

    • As noted in our guidelines, we expect all our code to follow default rustfmt, and not have clippy warnings, so have at least 1 lint step that checks these on the stable channel, and it's recommended to have one that does the same thing on the beta channel as well as new clippy lints can trigger failures in the next stable release
    • Have a stable test for all the platforms we support, which is usually windows, linux, and osx
    • Probably want to have at least 1 test that runs using the nightly channel, it's recommended to use linux for this as the VM spinup, rust install, compilation, and test runs are generally all faster on linux machines than the other platforms, particularly Windows
  3. Add a deploy step

    • Add a separate deploy stage that only runs on semver tags
    - test
    - name: deploy
      if: tag =~ /^\d+\.\d+\.\d+.*$/
    • If a lib/bin project, add a deploy step for publishing to
    - stage: deploy
      rust: stable
      os: linux
      script: echo "deploying $TRAVIS_TAG to"
        provider: cargo
          secure: <SEKRETZ>
          repo: EmbarkStudios/your-repo-name
          tags: true

    You should get an API token from Johan for the embark-studios Github bot we have, but Once you have the API token, you need to encrypt it, which you can do with travis-cli tool travis encrypt <token>. Then just copy and paste the token into the <SEKRETZ> placeholder.

    • If a bin project, copy what cargo-deny does, including all of the scripts. This will generate .tar.gz archives for all target platforms and upload them to Github releases so that people can install the binary without having to install Rust if that is their desire.
  4. Push your travis config and see how it goes!

Publishing New Versions

Given the above setup is followed correctly, publishing turns into a fairly trivial exercise.

  1. Change the version in Cargo.toml and commit
  2. Tag the commit git tag -a <version> -m "Release <version>". Example: git tag -a 0.1.0 -m "Release 0.1.0"
  3. Push the commit(s) and tag so that the release will be published automatically git push --follow-tags
You can’t perform that action at this time.