From 4f479ca3777f78f009216126752c18f66e6edeb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobranowski?= Date: Mon, 2 Mar 2026 14:36:09 +0100 Subject: [PATCH 1/2] Automatically publish new releases to Hex --- .github/workflows/release.yml | 23 +++++++++++++++++++++++ .github/workflows/revert-release.yml | 25 +++++++++++++++++++++++++ README.md | 9 +++++++++ 3 files changed, 57 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/revert-release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9ff36f8 --- /dev/null +++ b/.github/workflows/release.yml @@ -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" + - run: rebar3 compile + - run: rebar3 hex publish -r hexpm --yes + env: + HEX_API_KEY: ${{ secrets.HEX_API_KEY }} diff --git a/.github/workflows/revert-release.yml b/.github/workflows/revert-release.yml new file mode 100644 index 0000000..d0d8103 --- /dev/null +++ b/.github/workflows/revert-release.yml @@ -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" + - run: rebar3 hex publish --revert ${{ inputs.version }} -r hexpm --yes + env: + HEX_API_KEY: ${{ secrets.HEX_API_KEY }} diff --git a/README.md b/README.md index a954812..42076cf 100644 --- a/README.md +++ b/README.md @@ -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*. \ No newline at end of file From 8370583269e2961a8df4d4f4c6d4ec2980e86682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobranowski?= Date: Thu, 5 Mar 2026 15:49:03 +0100 Subject: [PATCH 2/2] Upgrade otp and rebar3 --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 4 ++-- .github/workflows/revert-release.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af5e18a..b7ddf63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: otp_vsn: ['28', '27', '26'] - rebar_vsn: ['3.25.0'] + rebar_vsn: ['3.27'] runs-on: 'ubuntu-24.04' env: OTPVER: ${{ matrix.otp }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ff36f8..ab30256 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,8 +15,8 @@ jobs: - uses: actions/checkout@v6 - uses: erlef/setup-beam@v1 with: - otp-version: "27" - rebar3-version: "3.26" + otp-version: "28" + rebar3-version: "3.27" - run: rebar3 compile - run: rebar3 hex publish -r hexpm --yes env: diff --git a/.github/workflows/revert-release.yml b/.github/workflows/revert-release.yml index d0d8103..42f8770 100644 --- a/.github/workflows/revert-release.yml +++ b/.github/workflows/revert-release.yml @@ -18,8 +18,8 @@ jobs: - uses: actions/checkout@v6 - uses: erlef/setup-beam@v1 with: - otp-version: "27" - rebar3-version: "3.26" + otp-version: "28" + rebar3-version: "3.27" - run: rebar3 hex publish --revert ${{ inputs.version }} -r hexpm --yes env: HEX_API_KEY: ${{ secrets.HEX_API_KEY }}