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

Added publishing of npm package to GitHub workflow #96

Merged
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
8 changes: 8 additions & 0 deletions .github/workflows/webviz-core-components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ jobs:
run: |
npm run test
pytest ./tests/py --headless

- name: 🔼 Build and publish Node.js package
if: github.event_name == 'release' && matrix.python-version == '3.6'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm version ${GITHUB_REF//refs\/tags\//}
npm publish --access public

- name: 🚢 Build and deploy Python package
if: github.event_name == 'release' && matrix.python-version == '3.6'
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- [#99](https://github.com/equinor/webviz-core-components/pull/99) - Fixed bug which prevented using the download button in `WebvizPluginPlaceholder` and started to download when component was mounting.

### Added
- [#96](https://github.com/equinor/webviz-core-components/pull/96) - Added publishing of npm package to Github Workflow

### Changed
- [#100](https://github.com/equinor/webviz-core-components/pull/100) - Adjusted build environment in order to be able to write
components in TypeScript and to publish to npm. Also changed all components to TypeScript.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "core-components",
"name": "@webviz/core-components",
"version": "0.0.1",
"description": "Core components for webviz config",
"repository": {
Expand Down
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
with open(os.path.join("webviz_core_components", "package-info.json")) as f:
package = json.load(f)

package_name = "webviz_" + package["name"].replace(" ", "_").replace("-", "_")
package_name = (
package["name"]
.replace(" ", "_")
.replace("-", "_")
.replace("/", "_")
.replace("@", "")
)

install_requires = ["dash>=1.6"]

Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");

const packagejson = require("./package.json");

const dashLibraryName = "webviz_" + packagejson.name.replace(/-/g, "_");
const dashLibraryName = packagejson.name.replace(/[-\/]/g, "_").replace(/@/g, "");

module.exports = (env, argv) => {
const overrides = module.exports || {};
Expand Down
8 changes: 7 additions & 1 deletion webviz_core_components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@
with open(_filepath) as f:
package = json.load(f)

package_name = "webviz_" + package["name"].replace(" ", "_").replace("-", "_")
package_name = (
package["name"]
.replace(" ", "_")
.replace("-", "_")
.replace("/", "_")
.replace("@", "")
)

_current_path = _os.path.dirname(_os.path.abspath(__file__))

Expand Down