RustTemplate

Requirements

All of the following have to be met in order for this template to work to its full potential and not encounter any issues. If you for example don’t want to upload to the AUR just edit .github/workflows/release.yml accordingly.

Dependencies

There are a few programs you should have installed in order to use this template if you don’t use NixOS or nix. Check their documentations if you have trouble installing them. Essentially on Linux you use your pkg manager and on Windows cargo install for everything but git and rust.

Bare minimum:

Required (for all the template features):

Optional:

Public GitHub repository

For all of the actions, branch rules etc. to be available (if you are a free GitHub user) the repository has to be public.

GitHub actions permissions

On your GitHub repository page go to Settings, Actions, General (the link should look like this: https://github.com/{USER}/{REPO}/settings/actions), scroll down to Workflow permissions and make sure Read and write permissions is selected. This is so the actions can create new releases.

Version scheme

You must use SemVer. Every release you make should look something like this: v0.1.0-stable or v0.1.0-beta. Note, only stable releases will make external changes like updating AUR stable pkgs or homebrew pkg.

homebrew-tap repository

You will need to have public repository on your account named homebrew-tap. When the you create a new stable release the GitHub actions will update/publish the homebrew version for macOS.

Action secrets

All of the following have to be added in the secrets tab for actions. To get here go to your GitHub repository page -> Settings -> Secrets and variables -> Actions -> Secrets tab (the link should look like this: https://github.com/{USER}/{REPO}/settings/secrets/actions). In order to add a secret click New repository secret.

API_TOKEN_GITHUB

Create a new access token, copy it and save it somewhere safe, you will not able to after. Create a new secret with the name API_TOKEN_GITHUB and paste the token in the secret box (second box).

AUR

You’ll need an AUR account with ssh keys for the next steps, if you don’t have one:

  1. Create a new account, you only need to provide a username, email and password (on the next page). Unfortunately you will need to boot an Arch Linux iso (if you don’t use Arch) to complete the captcha verification, but it’s only a one time thing.

  2. To generate a new key pair run: ssh-keygen -t ed25519 -C "your_email@example.com", replacing the example email with the one you used for your AUR account.

  3. Open you .pub file in ~/.ssh and copy everything besides your email, go to the My account page on AUR and paste it in the SSH Public Key section. Scroll down fill in your password and hit update.

AUR_USERNAME

Create a new secret with the name AUR_USERNAME fill in your AUR username in the secret box (second box).

AUR_EMAIL

Create a new secret with the name AUR_EMAIL fill in your AUR email in the secret box (second box).

AUR_SSH_PRIVATE_KEY

Open your ssh private key file in ~/.ssh (the one that doesn’t end in .pub) and copy everything. Create a new secret with the name AUR_SSH_PRIVATE_KEY and paste your key in the secret box (second box).

CRATES_TOKEN

You’ll need a crates.io token for the following steps, if you don’t have one:

  1. Login on crates.io using GitHub.
  2. Go to API tokens pages.
  3. Click New Token and save this token somewhere safe, you’ll not be able after.

Create a new secret with the name CRATES_TOKEN fill in your crates.io token in the secret box (second box).