-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to publish as npm package
- Loading branch information
Showing
10 changed files
with
163 additions
and
2 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,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: true | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
required: true | ||
|
||
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
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.idea/ | ||
dist/ | ||
*.log | ||
node_modules/ |
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,9 @@ | ||
cmd/ | ||
internal/ | ||
main.go | ||
vendor/ | ||
go.mod | ||
go.sum | ||
Makefile | ||
.goreleaser.yaml | ||
Dockerfile.goreleaser |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,35 @@ | ||
{ | ||
"name": "@launchdarkly/ldcli", | ||
"description": "The official command line interface for managing LaunchDarkly feature flags.", | ||
"version": "0.0.1", | ||
"main": "index.js", | ||
"scripts": { | ||
"postinstall": "go-npm install", | ||
"preuninstall": "go-npm uninstall" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/launchdarkly/ldcli.git" | ||
}, | ||
"keywords": [ | ||
"cli", | ||
"feature-flags", | ||
"feature-toggles", | ||
"command-line-interface", | ||
"launchdarkly-integration" | ||
], | ||
"author": "LaunchDarkly <team@launchdarkly.com>", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/launchdarkly/ldcli/issues" | ||
}, | ||
"homepage": "https://github.com/launchdarkly/ldcli#readme", | ||
"goBinary": { | ||
"name": "ldcli", | ||
"path": "./bin", | ||
"url": "https://github.com/launchdarkly/ldcli/releases/download/v{{version}}/ldcli_{{version}}_{{platform}}_{{arch}}.tar.gz" | ||
}, | ||
"dependencies": { | ||
"@go-task/go-npm": "^0.2.0" | ||
} | ||
} |
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,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 |