Skip to content

Commit

Permalink
Merge pull request #15 from cuweb/feature/npmPublish
Browse files Browse the repository at this point in the history
add: git actions
  • Loading branch information
troychaplin authored Oct 25, 2023
2 parents d5f391c + 224ff34 commit 0599bca
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 7 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and Deploy to S3
on: [push]
jobs:
build:
name: Build, Lint, and Test project on Node ${{ matrix.node }} and ${{ matrix.os }}
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['18.x'] # '16.x',
os: [ubuntu-latest] # macOS-latest windows-latest
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Node v${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Install
run: npm ci

- name: Build
run: npm run build

# - name: S3 Deploy
# uses: Reggionick/[email protected]
# with:
# folder: dist
# bucket: ${{ secrets.AWS_BUCKET_PATH }}
# bucket-region: ${{ secrets.AWS_DEFAULT_REGION }}
# delete-removed: false
# cache: true
# no-cache: false
# private: false
19 changes: 19 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.RDS_NPM_TOKEN}}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "@carletonuniversity/rds-forms",
"private": true,
"version": "0.0.0",
"private": false,
"version": "0.0.1",
"type": "module",
"main": "./dist/rds.umd.js",
"module": "./dist/rds.es.js",
"types": "./dist/index.d.ts",
"files": [
"/dist",
"/dist/index.css"
"/dist/rds-forms.css"
],
"exports": {
".": {
"style": "./dist/index.css",
"style": "./dist/rds-forms.css",
"import": "./dist/rds.es.js",
"require": "./dist/rds.umd.js"
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/FileUpload/FileUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface FileUploadProps {
required?: boolean;
}

export const FileUpload = (props: FileUploadProps) => {
export const FileUpload = ({ ...props }: FileUploadProps) => {
const { label, name, maxWidth, helper, required, ...rest } = props;
const fieldMaxWidth = maxWidth ? maxWidthClasses[maxWidth] : "";
const requiredClass = required ? primaryStyles.required : "";
Expand Down
2 changes: 1 addition & 1 deletion src/components/ImageUpload/ImageUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface ImageUploadProps {
required?: boolean;
}

export const ImageUpload = (props: ImageUploadProps) => {
export const ImageUpload = ({ ...props }: ImageUploadProps) => {
const { label, name, maxWidth, helper, required, ...rest } = props;
const fieldMaxWidth = maxWidth ? maxWidthClasses[maxWidth] : "";
const requiredClass = required ? primaryStyles.required : "";
Expand Down
2 changes: 1 addition & 1 deletion src/components/WYSIWYG/WYSIWYG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface WYSIWYGUploadProps {
required?: boolean;
}

export const WYSIWYG = (props: WYSIWYGUploadProps) => {
export const WYSIWYG = ({ ...props }: WYSIWYGUploadProps) => {
const { label, name, maxWidth, helper, required, ...rest } = props;
const fieldMaxWidth = maxWidth ? maxWidthClasses[maxWidth] : "";
const requiredClass = required ? primaryStyles.required : "";
Expand Down

0 comments on commit 0599bca

Please sign in to comment.