Skip to content

Commit

Permalink
maintenance: add dev publication workflow (#134)
Browse files Browse the repository at this point in the history
* maintenance: add dev publication workflow

* Automatic application of license header

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
fcollonval and github-actions[bot] authored Dec 19, 2023
1 parent f38517b commit 1b2fbbd
Show file tree
Hide file tree
Showing 21 changed files with 174 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/publish-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Publish package to GitHub Packages
on:
push:
branches:
- main
workflow_dispatch:

jobs:
publish:
# Forbid manual execution on non-main branches
if: github.ref_name == 'main'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
-
uses: actions/checkout@v4
-
# Setup .npmrc file to publish to GitHub Packages
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@datalayer'
-
if: github.event_name == 'push'
# Bump the version
working-directory: packages/react
run: |
yarn install
npm version --preid dev --no-git-tag-version prerelease
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git commit -a -m "Bump pre release version"
-
working-directory: packages/react
run: yarn npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

-
if: github.event_name == 'push'
# Push version bump
run: |
git push
# Keep only the 3 latest pre releases
- uses: actions/delete-package-versions@v4
with:
package-name: '@datalayer/jupyter-react'
package-type: 'npm'
min-versions-to-keep: 3
delete-only-pre-release-versions: "true"
6 changes: 6 additions & 0 deletions storybook/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
Expand Down
6 changes: 6 additions & 0 deletions storybook/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

import type { Preview } from "@storybook/react";

const preview: Preview = {
Expand Down
4 changes: 4 additions & 0 deletions storybook/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
#
# MIT License

# Copyright (c) Datalayer, Inc. https://datalayer.io
# Distributed under the terms of the MIT License.

Expand Down
6 changes: 6 additions & 0 deletions storybook/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
~ Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
~
~ MIT License
-->

<!doctype html>
<html lang="en">
<head>
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/App.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

#root {
max-width: 1280px;
margin: 0 auto;
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

import { useState } from 'react'
import reactLogo from './assets/react.svg'
import viteLogo from '/vite.svg'
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/stories/Button.stories.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

import type { Meta, StoryObj } from '@storybook/react';

import { Button } from './Button';
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/stories/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

import './button.css';

interface ButtonProps {
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/stories/Configure.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
~ Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
~
~ MIT License
-->

import { Meta } from "@storybook/blocks";

import Github from "./assets/github.svg";
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/stories/Header.stories.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

import type { Meta, StoryObj } from '@storybook/react';

import { Header } from './Header';
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/stories/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

import { Button } from './Button';

import './header.css';
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/stories/Page.stories.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

import type { Meta, StoryObj } from '@storybook/react';
import { within, userEvent, expect } from '@storybook/test';

Expand Down
6 changes: 6 additions & 0 deletions storybook/src/stories/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

import React from 'react';

import { Header } from './Header';
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/stories/button.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

.storybook-button {
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: 700;
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/stories/header.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

.storybook-header {
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/stories/page.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

.storybook-page {
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 14px;
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

/// <reference types="vite/client" />
6 changes: 6 additions & 0 deletions storybook/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2022-2023 Datalayer Inc. All rights reserved.
*
* MIT License
*/

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

Expand Down

0 comments on commit 1b2fbbd

Please sign in to comment.