Skip to content

Commit 7703aa2

Browse files
authored
chore: Use github actions for CI and release-please. (#289)
I will also make a release-please PR and hold merging this until both are ready.
1 parent 26eef1a commit 7703aa2

File tree

17 files changed

+183
-93
lines changed

17 files changed

+183
-93
lines changed

.circleci/config.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Publish Documentation
2+
description: 'Publish documentation to github pages.'
3+
4+
inputs:
5+
github_token:
6+
description: 'The github token to use for committing'
7+
required: true
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.2
13+
name: 'Publish to Github pages'
14+
with:
15+
docs_path: docs
16+
github_token: ${{ inputs.github_token }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Publish to NPM
2+
description: Publish an npm package.
3+
inputs:
4+
prerelease:
5+
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.'
6+
required: false
7+
dry-run:
8+
description: 'Is this a dry run. If so no package will be published.'
9+
required: false
10+
11+
runs:
12+
using: composite
13+
steps:
14+
- name: Publish
15+
shell: bash
16+
run: |
17+
./scripts/publish-npm.sh
18+
env:
19+
LD_RELEASE_IS_PRERELEASE: ${{ inputs.prerelease }}
20+
LD_RELEASE_IS_DRYRUN: ${{ inputs.dry-run }}

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths-ignore:
7+
- '**.md' #Do not need to run CI for markdown changes.
8+
pull_request:
9+
branches: [main]
10+
paths-ignore:
11+
- '**.md'
12+
13+
jobs:
14+
build-test:
15+
strategy:
16+
matrix:
17+
variations: [
18+
# {os: ubuntu-latest, node: latest},
19+
{os: ubuntu-latest, node: 'lts/*'},
20+
]
21+
22+
runs-on: ${{ matrix.variations.os }}
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.variations.node }}
29+
registry-url: 'https://registry.npmjs.org'
30+
- name: Install
31+
run: npm install
32+
- name: Build
33+
run: npm run build
34+
- name: Test
35+
run: npm test
36+
- name: Lint
37+
run: npm run lint
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release-please:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
release_created: ${{ steps.release.outputs.release_created }}
13+
steps:
14+
- uses: googleapis/release-please-action@v4
15+
id: release
16+
with:
17+
token: ${{secrets.GITHUB_TOKEN}}
18+
19+
publish-package:
20+
runs-on: ubuntu-latest
21+
needs: ['release-please']
22+
permissions:
23+
id-token: write
24+
contents: write
25+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: 20.x
32+
registry-url: 'https://registry.npmjs.org'
33+
34+
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0
35+
name: 'Get NPM token'
36+
with:
37+
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
38+
ssm_parameter_pairs: '/production/common/releasing/npm/token = NODE_AUTH_TOKEN'
39+
40+
- name: Install Dependencies
41+
run: npm install
42+
# Publishing will build because we have a prepublish script.
43+
44+
- id: publish-npm
45+
name: Publish NPM Package
46+
uses: ./.github/actions/publish-npm
47+
with:
48+
dry-run: 'false'
49+
prerelease: 'false'
50+
51+
- name: Build Documentation
52+
run: npm run doc
53+
54+
- id: publish-docs
55+
name: Publish Documentation
56+
uses: ./.github/actions/publish-docs
57+
with:
58+
github_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ docs/build/
1313
yarn.lock
1414
package-lock.json
1515
.npmrc
16+
docs/

.ldrelease/config.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "3.3.2"
3+
}

docs/typedoc.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
reporters: ['default', 'jest-junit'],
2+
reporters: ['default'],
33
moduleFileExtensions: ['ts', 'tsx', 'js'],
44
transform: {
55
'\\.(ts|tsx)$': 'ts-jest',

0 commit comments

Comments
 (0)