Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds release process to hex.pm #51

Merged
merged 6 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
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