Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish to Hex

on:
release:
types: [ released ] # pre- and draft releases are excluded
workflow_dispatch:

permissions:
contents: read

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: erlef/setup-beam@v1
with:
otp-version: "27"
rebar3-version: "3.26"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using '28' and '3.27 already? (latest versions). Also, you'll probably want to set up dependabot for this, considering you'll have now the otp versions hardcoded in three different github action files.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually stick to slightly older software versions instead of the very latest releases, but it's not a strong preference -- I'll switch to the newest version.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for Dependabot, I don't think there is an easy way to do this, since it does not support updating versions in "random" strings within scripts.

- run: rebar3 compile
- run: rebar3 hex publish -r hexpm --yes
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
25 changes: 25 additions & 0 deletions .github/workflows/revert-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Revert published version from Hex

on:
workflow_dispatch:
inputs:
version:
description: "Package version to revert (e.g. 1.0.0)"
required: true
type: string

permissions:
contents: read

jobs:
revert:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: erlef/setup-beam@v1
with:
otp-version: "27"
rebar3-version: "3.26"
Comment thread
mdbrnowski marked this conversation as resolved.
Outdated
- run: rebar3 hex publish --revert ${{ inputs.version }} -r hexpm --yes
Comment thread
NelsonVides marked this conversation as resolved.
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,12 @@ Notes
=====

The implementation uses C++ thread-local memory pools of size 10MB by default (override `RAPIDXML_STATIC_POOL_SIZE` and/or `RAPIDXML_DYNAMIC_POOL_SIZE` at compilation time if desired differently), to maximise cache locality and memory allocation patterns. To also improve performance, the NIF calls are not checking input size, nor timeslicing themselves, nor running in dirty schedulers: that means that if called with too big inputs, the NIFs can starve the VM. It's up to the dev to throttle the input sizes and fine-tune the memory pool sizes.

Releasing to Hex.pm
=====

Creating a GitHub release (non-draft, non-prerelease) automatically publishes the package to [Hex.pm](https://hex.pm/) via the **Publish to Hex** workflow.
This workflow can also be triggered manually from the Actions tab — make sure to run it from the specific tag you want to publish.

To revert a published version, run the **Revert published version from Hex** workflow from the Actions tab, providing the version to revert.
Hex.pm only allows reverting within 1 hour of publishing — after that, the version can only be *retired*.