-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add support for github actions and release-please. (#87)
- Loading branch information
1 parent
a1f0d64
commit 8fa0742
Showing
26 changed files
with
297 additions
and
244 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Use a step like this to build documentation. | ||
name: Build Documentation | ||
description: 'Build Documentation.' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Build Documentation | ||
shell: bash | ||
run: make doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This is a composite to allow sharing these steps into other workflows. | ||
# For instance it could be used by regular CI as well as the release process. | ||
|
||
name: CI Workflow | ||
description: "Shared CI workflow." | ||
inputs: | ||
run_tests: | ||
description: "If true, run unit tests, otherwise skip them." | ||
required: false | ||
default: "true" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- run: make compile | ||
shell: bash | ||
- uses: supercharge/redis-github-action@1.6.0 | ||
- run: make ci-tests | ||
shell: bash | ||
- uses: ./.github/actions/build-docs | ||
- run: make dialyze | ||
shell: bash | ||
- run: make build-contract-tests | ||
shell: bash | ||
- run: make start-contract-test-service-bg | ||
shell: bash | ||
- run: make run-contract-tests | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Configure Rebar3 | ||
description: 'Configure publishing token for Rebar3' | ||
inputs: | ||
aws_assume_role: | ||
description: 'The ARN of an AWS IAM role to assume. Used to auth with AWS to upload results to S3.' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.0 | ||
name: 'Get the hex publishing token' | ||
with: | ||
aws_assume_role: ${{ inputs.aws_assume_role }} | ||
ssm_parameter_pairs: '/production/common/releasing/hex/api_key = HEX_AUTH_TOKEN' | ||
- name: Configure rebar3 | ||
shell: bash | ||
run: ./.github/scripts/configure_rebar3.sh | ||
env: | ||
HEX_AUTH_TOKEN: ${{ env.HEX_AUTH_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Publish Documentation | ||
description: 'Publish the documentation to hex.pm and github pages.' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: launchdarkly/gh-actions/actions/publish-pages | ||
name: 'Publish to Github pages' | ||
with: | ||
docs_path: doc | ||
- run: rebar3 hex docs | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Publish Package | ||
description: 'Publish the package to Hex.pm' | ||
inputs: | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Publish Library | ||
shell: bash | ||
run: rebar3 hex publish | ||
# Do not publish a dry run. | ||
if: ${{ inputs.dry_run == 'false' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
# Make the directory the configuration should be stored in. | ||
mkdir -p ~/.config/rebar3/ | ||
|
||
# Create rebar config with hex plugin. | ||
cat >~/.config/rebar3/rebar.config <<EOF | ||
{plugins, [{rebar3_hex, "6.11.9"}]}. | ||
EOF | ||
|
||
# Create a hex.config file to allow publishing. | ||
# Note: The indentation here translates to the output file, | ||
# and the EOF must be at the start of the line. | ||
cat >~/.config/rebar3/hex.config <<EOF | ||
%% coding: utf-8 | ||
#{<<"hexpm">> => | ||
#{username => <<"launchdarkly">>, | ||
api_key => <<"${HEX_AUTH_TOKEN}">>}}. | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Build and Test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths-ignore: | ||
- '**.md' #Do not need to run CI for markdown changes. | ||
pull_request: | ||
branches: [main] | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
build-test: | ||
strategy: | ||
matrix: | ||
versions: | ||
- {os: 'ubuntu-20.04', otp: '21.x', rebar: '3.15.2'} | ||
- {os: 'ubuntu-22.04', otp: '24.x', rebar: '3.18.0'} | ||
- {os: 'ubuntu-22.04', otp: '25.x', rebar: '3.18.0'} | ||
|
||
runs-on: ${{ matrix.versions.os }} | ||
name: Build and Test - ${{ matrix.versions.otp }} | ||
|
||
steps: | ||
- uses: erlef/setup-beam@v1 | ||
with: | ||
version-type: loose | ||
otp-version: ${{ matrix.versions.otp }} | ||
rebar3-version: ${{ matrix.versions.rebar }} | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: ./.github/actions/ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Lint PR title | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
lint-pr-title: | ||
uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
on: | ||
workflow_dispatch: | ||
|
||
name: Publish Documentation | ||
jobs: | ||
build-publish: | ||
runs-on: ubuntu-22.04 | ||
# Needed to get tokens during publishing. | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- uses: erlef/setup-beam@v1 | ||
with: | ||
version-type: loose | ||
otp-version: 25.x | ||
rebar3-version: 3.18.0 | ||
- uses: actions/checkout@v3 | ||
- id: build | ||
name: Build Documentation | ||
uses: ./.github/actions/build-docs | ||
|
||
- uses: ./.github/actions/configure-rebar | ||
with: | ||
aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
|
||
- id: publish | ||
name: Publish Documentation | ||
uses: ./.github/actions/publish-docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Manual Publish Package | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
type: boolean | ||
required: true | ||
|
||
jobs: | ||
manual-build-publish: | ||
runs-on: ubuntu-22.04 | ||
# Needed to get tokens during publishing. | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- uses: erlef/setup-beam@v1 | ||
with: | ||
version-type: loose | ||
otp-version: 25.x | ||
rebar3-version: 3.18.0 | ||
- uses: actions/checkout@v3 | ||
- id: build-and-test | ||
# Build using the same steps from CI. | ||
name: Build and Test | ||
uses: ./.github/actions/ci | ||
|
||
- uses: ./.github/actions/configure-rebar | ||
with: | ||
aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
if: ${{ !inputs.dry_run }} | ||
|
||
- id: publish | ||
name: Publish Package | ||
uses: ./.github/actions/publish | ||
with: | ||
dry_run: ${{ inputs.dry_run }} |
Oops, something went wrong.