From 4aca3cb2ad295776ca4d927cac28c737387c4582 Mon Sep 17 00:00:00 2001 From: Troy Chaplin Date: Tue, 24 Oct 2023 22:28:09 -0400 Subject: [PATCH 1/2] add: git actions --- .github/workflows/main.yml | 39 ++++++++++++++++++++++ .github/workflows/publish.yml | 19 +++++++++++ .github/workflows/size.yml | 12 +++++++ src/components/FileUpload/FileUpload.tsx | 2 +- src/components/ImageUpload/ImageUpload.tsx | 2 +- src/components/WYSIWYG/WYSIWYG.tsx | 2 +- 6 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/size.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..0e96ee9 --- /dev/null +++ b/.github/workflows/main.yml @@ -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/s3-deploy@v3.2.0 + # with: + # folder: dist + # bucket: ${{ secrets.AWS_BUCKET_PATH }} + # bucket-region: ${{ secrets.AWS_DEFAULT_REGION }} + # delete-removed: false + # cache: true + # no-cache: false + # private: false diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b7d3671 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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}} diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml new file mode 100644 index 0000000..6a64be7 --- /dev/null +++ b/.github/workflows/size.yml @@ -0,0 +1,12 @@ +name: Size Check +on: [pull_request] +jobs: + size: + runs-on: ubuntu-latest + env: + CI_JOB_NUMBER: 1 + steps: + - uses: actions/checkout@v3 + - uses: andresz1/size-limit-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/components/FileUpload/FileUpload.tsx b/src/components/FileUpload/FileUpload.tsx index 667d047..810155b 100644 --- a/src/components/FileUpload/FileUpload.tsx +++ b/src/components/FileUpload/FileUpload.tsx @@ -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 : ""; diff --git a/src/components/ImageUpload/ImageUpload.tsx b/src/components/ImageUpload/ImageUpload.tsx index 7e8bc34..fdcb852 100644 --- a/src/components/ImageUpload/ImageUpload.tsx +++ b/src/components/ImageUpload/ImageUpload.tsx @@ -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 : ""; diff --git a/src/components/WYSIWYG/WYSIWYG.tsx b/src/components/WYSIWYG/WYSIWYG.tsx index 394c445..c589e6c 100644 --- a/src/components/WYSIWYG/WYSIWYG.tsx +++ b/src/components/WYSIWYG/WYSIWYG.tsx @@ -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 : ""; From 224ff3451734d620a54fb9be45c59f2f05888221 Mon Sep 17 00:00:00 2001 From: Troy Chaplin Date: Tue, 24 Oct 2023 22:33:53 -0400 Subject: [PATCH 2/2] change: removed size action --- .github/workflows/size.yml | 12 ------------ package.json | 8 ++++---- 2 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 .github/workflows/size.yml diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml deleted file mode 100644 index 6a64be7..0000000 --- a/.github/workflows/size.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Size Check -on: [pull_request] -jobs: - size: - runs-on: ubuntu-latest - env: - CI_JOB_NUMBER: 1 - steps: - - uses: actions/checkout@v3 - - uses: andresz1/size-limit-action@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 990c0a1..a991221 100644 --- a/package.json +++ b/package.json @@ -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" }