Mods can be automatically Packaged and Published from the "Factorio Mod Packages" panel (in SCM view by default, View->Open View...-> "Factorio Mod Packages" if you can't find it).
Interacting with the Mod Portal requires an API key, which you can create at https://factorio.com/profile. You will be prompted for this key when it is required by tasks, and then it will be stored in the OS keychain (Windows Credential Manager, macOS Keychain, Linux Secret Service API/libsecret) if available. You can also provide the API key as an environment variable FACTORIO_UPLOAD_API_KEY
to the cli tool fmtk
, which will take precedence over the keychain.
Uploading new releases (upload
, publish
commands) requires a key with the ModPortal: Upload Mods
permission.
Updating mod details (details
, publish
commands) requires a key with the ModPortal: Edit Mods
permission.
These tasks can also be accessed in VSCode's Tasks system. Custom scripts will run inside the mod directory and have the environment variables FACTORIO_MODNAME
and FACTORIO_MODVERSION
provided. Tasks can also be run from command line with fmtk
.
- run any script from
info.json#/package/scripts[name]
- if changelog.txt present and has a section for the current version, update its date to today
- run
info.json#/package/scripts/datestamp
if set
- run
info.json#/package/scripts/compile
if set - run
info.json#/package/scripts/prepackage
if set - build a zip including all files in the mod directory except dotfiles, zip files named
modname_*.zip
, and files matching the list of globs ininfo.json#/package/ignore
. If you need to include other files, you can list additional root directories ininfo.json#/package/extra
. You are responsible for ensuring that you don't include directories that result in two files of the same name in the zip! (Because my zip library doesn't tell me when this happens.)
- increment version in info.json
- if changelog.txt present, add new empty section to changelog.txt
- run
info.json#/package/scripts/version
if set
- select a package in mod directory
- upload to mod portal
- update mod portal information:
- title, homepage, summary from
info.json#/title
,info.json#/homepage
,info.json#/description
- upload readme.md (or file named in
info.json#/package/readme
) to mod portal long description - upload faq.md (or file named in
info.json#/package/faq
) to mod portal long description
- title, homepage, summary from
- sync gallery:
- images listed in
info.json#/package/gallery
if set - any local images used by readme/faq will be added to the end of the gallery
- images listed in
All-in-one command.
- verify no uncommitted changes, on default branch (
git config init.defaultBranch
, or branch set ininfo.json#/package/git_publish_branch
) - run
info.json#/package/scripts/prepublish
if set - run Datestamp
- git commit "preparing release of version x.y.z", tag x.y.z
- run Package
- git tag, unless
info.json#/package/no_git_tag
is set - run
info.json#/package/scripts/publish
if set - upload to mod portal, unless
info.json#/package/no_portal_upload
is set- also run Details if
info.json#/package/sync_portal_details
is set
- also run Details if
- run
info.json#/package/scripts/postpublish
if set, with extra environment variableFACTORIO_MODPACKAGE
with the filename of the built zip in a temporary folder. - run Increment Version
- commit "moved to version x.y.z"
- push to git upstream, unless
info.json#/package/no_git_push
is set