From c2f20a78dfd94ca6b5cf4dd8845783f0d791fc74 Mon Sep 17 00:00:00 2001 From: Santiago Traversa Date: Mon, 3 Feb 2025 16:30:45 -0300 Subject: [PATCH] Adds release process to hex.pm (#51) * Adds markdownlint - CONTRIBUTING.md:5 MD001/heading-increment Heading levels should only increment by one level at a time [Expected: h3; Actual: h4] - README.md:66:234 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] * Adds YAMLlint ./.github/dependabot.yml 1:1 warning missing document start "---" (document-start) ./.github/workflows/check_deps.yml 1:1 warning missing document start "---" (document-start) ./.github/workflows/ci.yml 1:1 warning missing document start "---" (document-start) 6:16 error too many spaces inside brackets (brackets) 6:23 error too many spaces inside brackets (brackets) * Adds YAMLlint and Markdown linter to CI * Adds release process to hex.pm - Adds CHANGELOG.md file - Updates CONTRIBUTING.md file * Adds app description for hex.pm --- .github/workflows/release.yml | 20 ++++++++++++ CHANGELOG.md | 24 +++++++++++++++ CONTRIBUTING.md | 57 +++++++++++++++++++++++++---------- src/dns_erlang.app.src | 2 +- 4 files changed, 86 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..111ddfc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,20 @@ +--- + +name: Release + +on: + push: + tags: + - v*.*.* + +jobs: + publish: + runs-on: ubuntu-22.04 + steps: + - name: Check out + uses: actions/checkout@v4 + + - name: Publish to Hex.pm + uses: erlangpack/github-action@v3 + env: + HEX_API_KEY: ${{ secrets.HEX_API_KEY }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1ba57e7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,24 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## main + +### Changed + +- Bumps to OTP/27 +- Replaced "jsx" with "json" + +### Added + +- Erlfmt +- CONTRIBUTING.md +- CHANGELOG.md +- Release process to hex.pm + +## 1.1.0 + +- ... diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6a48890..7a7cd9a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contributing to DNSimple/dns_erlang +# Contributing to dns_erlang ## Getting started @@ -13,47 +13,72 @@ cd dns_erlang ### 2. Install Erlang -### 3. Create your own working branch +### 3. Install the dependencies ```shell -git checkout -b dev_new_feature_xyz +make ``` -### 3. Build and test +#### Updating Dependencies -Compile the project and [run the test suite](#testing) to check everything works as expected. +When dependencies are updated the rebar.lock file will need to be updated for the new dependency to be used. The following command does this: ```shell -make all +./rebar3 upgrade --all ``` -## Testing +## Formatting + +If your editor doesn't automatically format Erlang code using [erlfmt](https://github.com/WhatsApp/erlfmt), run: ```shell -make test +make format ``` -## Formatting +You should run this command before releasing. + +### 3. Build and test -To format the codebase: +Compile the project and [run the test suite](#testing) to check everything works as expected. + +## Testing ```shell -make format +make test ``` ## Releasing +The following instructions uses `$VERSION` as a placeholder, where `$VERSION` is a `MAJOR.MINOR.BUGFIX` release such as `1.2.0`. + 1. Run the test suite and ensure all the tests pass. -2. Commit and push the changes +1. Set the version in `src/dns_erlang.app.src` & `src/bugsnag.erl` + +1. Run the test suite and ensure all the tests pass. + +1. Finalize the `## main` section in `CHANGELOG.md` assigning the version. + +1. Commit and push the changes ```shell - git commit -a -m "* ## Tests -Please be sure to submit unit tests for your changes. You can test your changes on your machine by [running the test suite](#testing). +Submit unit tests for your changes. You can test your changes on your machine by [running the test suite](#testing). + +When you submit a PR, tests will also be run on the [continuous integration environment via GitHub Actions](https://github.com/dnsimple/dnsimple-ruby/actions/workflows/ci.yml). diff --git a/src/dns_erlang.app.src b/src/dns_erlang.app.src index 5ae96c7..4d2fafa 100644 --- a/src/dns_erlang.app.src +++ b/src/dns_erlang.app.src @@ -1,5 +1,5 @@ {application, dns_erlang, [ - {description, "DNS library"}, + {description, "An Erlang DNS message library that supports most common record types, TSIG authenticated messages, EDNS0 and DNSSEC."}, {vsn, "1.1.0"}, {licenses, ["Apache"]}, {modules, []},