Publish Software
Publish a release to a Nexigon repository with Nexigon CLI, so that devices
and other clients can download it. A repository
stores files as assets. A package groups the releases of one piece of
software, and a package version attaches the files of one release under
their download filenames. Tags such as v2.0.0 or stable name versions,
so that clients can find a release without knowing its ID.
This guide publishes a release with two files. System updates and apps expect specific filenames and metadata on top of this workflow; Set Up System Updates and Set Up Rugix Apps describe them.
Before You Start
You need:
- Nexigon CLI installed and configured, with permission to manage the repository’s assets, packages, and versions.
- A repository with working S3 storage.
- Bash and
jq, which the examples use to read IDs from JSON output.
This example publishes application-amd64.tar.gz and
application-arm64.tar.gz to the application package of the repository with
the path name my-repo. Replace these names with your own, and run the
commands in one shell, from the directory that contains the files.
The Nexigon CLI commands assume an organization API token. With a user token,
add --organization <org-id> to each command, as
Organization Selection
describes. For automation, use an
organization API token
scoped to the target repository and package. Publishing to an existing package
needs repository view and manage_assets and package view and
manage_versions. Creating a package also needs repository manage_packages.
Create the Package
Create the package once:
nexigon-cli repositories packages create my-repo application
Later releases use the same package. repositories packages info my-repo/application shows an existing package.
Create a Version
Create the version without a tag, so that no client finds the release before its files are attached:
set -euo pipefail
version_json=$(nexigon-cli repositories versions create my-repo/application \
--name "Release 2.0.0" \
--metadata '{"gitCommit": "abc1234"}')
version_id=$(printf '%s\n' "$version_json" | jq -er '.versionId')
printf 'Version ID: %s\n' "$version_id"
The display name describes the release but is not a tag. The optional metadata is a JSON object of your choice. Use the version ID in the following commands, so that they address this version even if a tag changes.
Upload and Attach the Files
Upload each file and attach it to the version:
for file in application-amd64.tar.gz application-arm64.tar.gz; do
asset_json=$(nexigon-cli repositories assets upload my-repo "$file")
asset_id=$(printf '%s\n' "$asset_json" | jq -er '.assetId')
nexigon-cli repositories versions assets add "$version_id" "$asset_id" "$file"
done
Uploading stores the file’s content in the repository. If the repository
already contains the same content, the upload returns the existing asset, so
several releases can share a file without storing it twice. Attaching gives
the asset a filename within the version, the last argument of versions assets add. Filenames are unique within a version.
Check the Contents and Tag the Release
Check that the version lists both filenames:
nexigon-cli repositories versions info "$version_id"
Then add a locked release tag and resolve it:
nexigon-cli repositories versions tag "$version_id" --tag v2.0.0,locked
nexigon-cli repositories versions info my-repo/application/v2.0.0
A locked tag always refers to the same version. Locking the tag does not protect the version’s files; sealing does, once the release is complete.
Verify a Download
Request a download URL for one of the files, download it, and compare it with the original:
download_json=$(nexigon-cli repositories issue-url \
my-repo/application/v2.0.0/application-arm64.tar.gz)
download_url=$(printf '%s\n' "$download_json" | jq -er '.url')
curl --fail --location "$download_url" --output downloaded-application-arm64.tar.gz
cmp application-arm64.tar.gz downloaded-application-arm64.tar.gz
cmp prints nothing if the files match. The URL expires after a while; the
path my-repo/application/v2.0.0/application-arm64.tar.gz remains a stable
reference from which clients request a new URL.
Promote a Channel
A floating tag such as stable names a channel that clients follow. Move it
to the new version:
nexigon-cli repositories versions tag "$version_id" --tag stable,reassign
reassign moves the tag from the version that had it. Clients that follow
stable resolve the new version at their next check. You can promote the same
version through several channels, for example from beta to stable, without
uploading its files again.
If the repository is private, link it to the devices’ project under Project Settings → Linked Repositories, so that the devices can download from it.
Resume an Interrupted Publish
If publishing stops before the tag is added, run versions info with the
saved version ID, attach the missing files, and add the tag. Running
versions create again creates another, separate version.
Next Steps
- Retain and Clean Up Versions protects releases and deletes routine builds.
- Deploy System Updates and Deploy Applications roll releases out to devices.