-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Migrate to github actions. (#305)
- Loading branch information
1 parent
4d323c5
commit f10cfb2
Showing
16 changed files
with
204 additions
and
77 deletions.
There are no files selected for viewing
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,16 @@ | ||
name: Publish Documentation | ||
description: 'Publish documentation to github pages.' | ||
|
||
inputs: | ||
github_token: | ||
description: 'The github token to use for committing' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: launchdarkly/gh-actions/actions/[email protected] | ||
name: 'Publish to Github pages' | ||
with: | ||
docs_path: docs | ||
github_token: ${{ inputs.github_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,20 @@ | ||
name: Publish to NPM | ||
description: Publish an npm package. | ||
inputs: | ||
prerelease: | ||
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.' | ||
required: false | ||
dry-run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
required: false | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Publish | ||
shell: bash | ||
run: | | ||
./scripts/publish-npm.sh | ||
env: | ||
LD_RELEASE_IS_PRERELEASE: ${{ inputs.prerelease }} | ||
LD_RELEASE_IS_DRYRUN: ${{ inputs.dry-run }} |
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,41 @@ | ||
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: | ||
variations: [ | ||
{os: ubuntu-latest, node: latest}, | ||
{os: ubuntu-latest, node: 18} | ||
] | ||
|
||
runs-on: ${{ matrix.variations.os }} | ||
env: | ||
TEST_SERVICE_PORT: 8000 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.variations.node }} | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install | ||
run: npm install | ||
- name: Test | ||
run: npm test | ||
- name: Lint | ||
run: npm run lint:all | ||
- name: Check typescript | ||
run: npm run check-typescript | ||
- name: Build Docs | ||
run: npm run 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,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,57 @@ | ||
name: Release Please | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_created: ${{ steps.release.outputs.release_created }} | ||
steps: | ||
- uses: googleapis/release-please-action@v4 | ||
id: release | ||
with: | ||
token: ${{secrets.GITHUB_TOKEN}} | ||
|
||
publish-package: | ||
runs-on: ubuntu-latest | ||
needs: ['release-please'] | ||
permissions: | ||
id-token: write | ||
contents: write | ||
if: ${{ needs.release-please.outputs.release_created == 'true' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- uses: launchdarkly/gh-actions/actions/[email protected] | ||
name: 'Get NPM token' | ||
with: | ||
aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
ssm_parameter_pairs: '/production/common/releasing/npm/token = NODE_AUTH_TOKEN' | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- id: publish-npm | ||
name: Publish NPM Package | ||
uses: ./.github/actions/publish-npm | ||
with: | ||
dry-run: 'false' | ||
prerelease: 'false' | ||
|
||
- name: Build Documentation | ||
run: npm run doc | ||
|
||
- id: publish-docs | ||
name: Publish Documentation | ||
uses: ./.github/actions/publish-docs | ||
with: | ||
github_token: ${{ secrets.GITHUB_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 |
---|---|---|
|
@@ -10,3 +10,4 @@ lib | |
test-types.js | ||
docs/build/ | ||
package-lock.json | ||
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,3 @@ | ||
{ | ||
".": "3.4.0" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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 @@ | ||
{ | ||
"bootstrap-sha": "4d323c5e7cd7d509cfeb1be3a7446b10d94697a6", | ||
"packages": { | ||
".": { | ||
"release-type": "node", | ||
"include-v-in-tag": false, | ||
"include-component-in-tag": 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,11 @@ | ||
#!/usr/bin/env bash | ||
if $LD_RELEASE_IS_DRYRUN ; then | ||
echo "Doing a dry run of publishing." | ||
else | ||
if $LD_RELEASE_IS_PRERELEASE ; then | ||
echo "Publishing with prerelease tag." | ||
npm publish --tag prerelease --provenance --access public || { echo "npm publish failed" >&2; exit 1; } | ||
else | ||
npm publish --provenance --access public || { echo "npm publish failed" >&2; exit 1; } | ||
fi | ||
fi |
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,17 @@ | ||
{ | ||
"$schema": "https://typedoc.org/schema.json", | ||
"name": "launchdarkly-js-client-sdk", | ||
"includeVersion": true, | ||
"entryPoints": [ | ||
"typings.d.ts", | ||
], | ||
"readme": "none", | ||
"visibilityFilters": { | ||
"protected": false, | ||
"private": false, | ||
"inherited": true, | ||
"external": true, | ||
"@alpha": false, | ||
"@beta": 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