Publishing a Release
View SourceThis project uses automated workflows to manage releases. Follow these steps to publish a new version.
Process
Update the version (use one of the two methods below):
Automated
$ make bump-version Bumping version from 0.2.1 to 0.2.2 Changed: {vsn, "0.2.1"} -> {vsn, "0.2.2"} Commit this change? [Y/n] [main 443a400] Bump version to 0.2.2 2 files changed, 25 insertions(+), 2 deletions(-) **Push the change** $ git push origin mainManual<br/> Update the version in
glazer.app.src:{vsn,"2.3.1"}Commit the version bump and push the change:
$ git add src/glazer.app.src $ git commit -m "Bump version to 2.3.1" $ git push origin main
Automatic release on push: Pushing a commit to
maintriggers thebuildworkflow (erlang.yaml) as usual. Once the full build matrix (Linux, macOS, Windows) succeeds, the workflow publishes to Hex.pm and retires the prior version as deprecated if either:- The
vsninsrc/glazer.app.srcchanged compared to the parent commit, or - The
vsnis unchanged but this commit landed within an hour of the previous one — treated as a quick follow-up fix to the same release, and republished with--replace
If the build fails, nothing is published. No git tag is created at this point — publishing to Hex.pm doesn't depend on one.
- The
Delayed tag creation: An hourly scheduled run of
release.yamlchecks whether the latest non-retired version published on Hex.pm already has a matching git tag. If not, it locates the commit onmainthat introduced that version and, once that commit is at least 6 hours old, creates/pushes the tag for it. The age check leaves a window for amended re-publishes of the same version on Hex.pm before it gets tagged. This also keeps tag creation decoupled from publishing, so a flaky publish doesn't leave behind a tag for a version that never made it to Hex.pm.
Key Features
- Build-gated publishing: Publishing to Hex.pm only happens after the
full
buildmatrix (Linux, macOS, Windows) succeeds for a push tomainthat bumpsvsn(or quickly follows a bump, see above) - Idempotent publishing:
publish-to-hexchecks whether the version is already on Hex.pm before publishing, so re-running the workflow is safe - Tags follow Hex.pm: Git tags are created after the fact for whatever non-retired version is actually live on Hex.pm, not the other way around
- Tagging delay: Tags are only created for a version-bump commit once it's at least 6 hours old, allowing amended re-publishes of the same version before it's tagged
Setup Requirements
The automated workflow requires proper GitHub token configuration:
1. Personal Access Token (PAT)
The scheduled job needs to push tags in a way that triggers other workflows.
The default GITHUB_TOKEN cannot trigger workflows for security reasons, so
a Personal Access Token is required.
Create and configure RELEASE_PAT:
- Go to Profile → Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Give it a name like "Release Workflow Token"
- Select the following scopes:
repo— Full control of private repositoriesworkflow— Update GitHub Actions workflows
- Click "Generate token" and copy the token (you can only see it once)
- Add it to your repository secrets:
- Go to your repo → Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
RELEASE_PAT - Value: Paste the token you just created
2. Hex API Key
For publishing to Hex.pm, configure your API key:
- Go to your repository → Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
HEX_API_KEY - Value: Your Hex.pm API key (from https://hex.pm/users/account/keys)
Troubleshooting
- Release not published: Confirm the
buildworkflow (erlang.yaml) succeeded for the push — publishing only runs afterlinux,macOS, andwindowsall pass. Also confirm either the push changed the{vsn, "..."}line insrc/glazer.app.srccompared to the parent commit, or it landed within an hour of the commit that did, and verify the Hex API key is configured in repository secrets (HEX_API_KEY) - Tag not created: The scheduled job only tags a version once it's
visible via
mix hex.info glazer, the version is not retired on Hex.pm, and the version-bump commit is at least 6 hours old — wait for a later hourly run, or check that the publish actually succeeded - Version mismatch: Ensure the version in
src/glazer.app.srcmatches the intended release version (without thevprefix) - API key revoked: Getting
Failed to publish package glazer - 0.1.0 : API key revokederror. Ensure to callrebar3 hex user deauthandrebar3 hex user authbeforerebar3 hex publish