Skip to content

Commit

Permalink
Adds release process to hex.pm (#51)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
san983 authored Feb 3, 2025
1 parent 4fd4661 commit c2f20a7
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 17 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

- ...
57 changes: 41 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to DNSimple/dns_erlang
# Contributing to dns_erlang

## Getting started

Expand All @@ -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 "* <adding feature/enhancement X/Y/Z"
git push origin dev_new_feature_xyz
git commit -a -m "Release $VERSION"
git push origin main
```

3. Initiate PR for reviewing and merging upstream.
1. Wait for CI to complete.

1. Create a signed tag.

```shell
git tag -a v$VERSION -s -m "Release $VERSION"
git push origin --tags
```

1. GitHub actions will take it from there and release to <https://hex.pm/packages/dns_erlang>

## 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).
2 changes: 1 addition & 1 deletion src/dns_erlang.app.src
Original file line number Diff line number Diff line change
@@ -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, []},
Expand Down

0 comments on commit c2f20a7

Please sign in to comment.