Publishing a Package on GitHub
Flix packages are published on GitHub.
Automatically Publishing a Package
Flix can automatically package and publish artifacts on GitHub by following these steps:
- Check that you have a
flix.toml
manifest (if not create one withinit
). - Check that the version field in
flix.toml
is correct. - Check that the repository field in
flix.toml
is correct. (e.g.repository = "github:user/repo"
) - Check that you have a GitHub token which has read and write access to
Contents
for the relevant repository.- If not go to GitHub and navigate to
Settings > Developer settings > Personal access tokens
and create a new token.
- If not go to GitHub and navigate to
- Run
check
andtest
to ensure that everything looks alright. - Run
release --github-token <TOKEN>
. You should see:
Found `flix.toml'. Checking dependencies...
Resolving Flix dependencies...
Downloading Flix dependencies...
Resolving Maven dependencies...
Running Maven dependency resolver.
Downloading external jar dependencies...
Dependency resolution completed.
Release github:user/repo v1.2.3? [y/N]: y
Building project...
Publishing new release...
Successfully released v1.2.3
https://github.com/user/repo/releases/tag/v1.2.3
Tip: See the Museum Project for an example of a package that has been published on GitHub.
Tip: Flix will read the GitHub token from the environment variable
GITHUB_TOKEN
, if available.
Tip: Flix will also read the GitHub token from the file
.GITHUB_TOKEN
, if available.
Note: You cannot publish artifacts for empty GitHub repositories.
Warning: Be sure to keep your token safe!
Manually Publishing a Package
A package can also be manually published by following these steps:
- Check that you have a
flix.toml
manifest (if not create one withinit
). - Check that the version field in
flix.toml
is correct. - Run
check
andtest
to ensure that everything looks correct. - Run
build-pkg
. Check that theartifact
directory is populated. - Go to the repository on GitHub:
- Click "Releases".
- Click "Draft new release".
- Enter a tag of the form
v1.2.3
(i.e. use SemVer). - Upload the
package.fpkg
andflix.toml
from theartifact
directory.
Warning: You must upload both the package file (
foo.fpkg
) and the manifest file (flix.toml
).