Skip to content

Commit

Permalink
Merge pull request #39 from fsegurai/development
Browse files Browse the repository at this point in the history
merge development 18.0.0-beta.6
  • Loading branch information
fsegurai authored Oct 23, 2024
2 parents 71d3614 + 0fa8a15 commit 96f592f
Show file tree
Hide file tree
Showing 27 changed files with 466 additions and 211 deletions.
75 changes: 0 additions & 75 deletions .github/workflows/angular-CI_CD.yml

This file was deleted.

110 changes: 110 additions & 0 deletions .github/workflows/demo-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Deploy to GitHub Pages

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

permissions:
contents: write
pages: write
id-token: write

jobs:
Build:
runs-on: ubuntu-latest
environment: github-pages
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js - Version ${{ vars.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION }}
cache: 'yarn'

- name: Create cache directories
run: mkdir -p ~/.cache/yarn && mkdir -p ${{ github.workspace }}/.yarn

- name: Cache Yarn dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/yarn
${{ github.workspace }}/.yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build demo
run: |
yarn gh-pages:build
yarn gh-pages:copy404
yarn gh-pages:postBuild
- name: Upload build artifacts
if: |
github.ref == 'refs/heads/main' &&
github.event.repository.fork == false
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: ${{ vars.DEMO_PATH }}
if-no-files-found: error

Test:
runs-on: ubuntu-latest
environment: github-pages
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js - Version ${{ vars.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION }}
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Test Lint
run: yarn lint:demo

- name: Test TypeScript
run: yarn type-check:demo

- name: Test library
run: yarn test:ci_cd

Release:
if: |
github.ref == 'refs/heads/main' &&
github.event.repository.fork == false
runs-on: ubuntu-latest
environment: github-pages
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: ${{ vars.DEMO_PATH }}

- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ vars.DEMO_PATH }}
publish_branch: gh-pages
force_orphan: true
133 changes: 133 additions & 0 deletions .github/workflows/npm-publish-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: NPM Publish Setup

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
Build:
runs-on: ubuntu-latest
environment: FSI_DEP_NodeJs
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js - Version ${{ vars.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION }}
cache: 'yarn'

- name: Create cache directories
run: mkdir -p ~/.cache/yarn && mkdir -p ${{ github.workspace }}/.yarn

- name: Cache Yarn dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/yarn
${{ github.workspace }}/.yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build demo
run: |
yarn build:lib
yarn postBuild:lib
- name: Upload build artifacts
if: |
github.ref == 'refs/heads/main' &&
github.event.repository.fork == false
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: ${{ vars.DEMO_PATH }}
if-no-files-found: error

Test:
runs-on: ubuntu-latest
environment: FSI_DEP_NodeJs
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Node.js - Version ${{ vars.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION }}
cache: 'yarn'

- name: Create cache directories
run: mkdir -p ~/.cache/yarn && mkdir -p ${{ github.workspace }}/.yarn

- name: Cache Yarn dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/yarn
${{ github.workspace }}/.yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Test Lint
run: yarn lint:lib

- name: Test TypeScript
run: yarn type-check:lib

Release:
needs: [Build, Test]
if: |
github.ref == 'refs/heads/main' &&
github.event.repository.fork == false
runs-on: ubuntu-latest
environment: FSI_DEP_NodeJs
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Node.js ${{ vars.NODE_VERSION }} for NPM registry
uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION }}
cache: 'yarn'
registry-url: "https://registry.npmjs.org/"
scope: ${{ vars.NPM_ORG }}
always-auth: true

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: ${{ vars.DEMO_PATH }}

- name: Release to NPM registry 🚀
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm publish --access public || echo "Package already published in NPM, skipping..."
- name: Set up Node.js ${{ vars.NODE_VERSION }} for GitHub NPM registry
uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION }}
registry-url: "https://npm.pkg.github.com/"
scope: ${{ vars.NPM_ORG }}
always-auth: true

- name: Release to GitHub NPM registry 🚀
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_GH_TOKEN }}
run: npm publish && npx semantic-release || echo "Package already published in GitHub NPM, skipping..."
Loading

0 comments on commit 96f592f

Please sign in to comment.