Skip to content

Commit

Permalink
Add Vara UI (#1346)
Browse files Browse the repository at this point in the history
Co-authored-by: Dmitry Osipov <[email protected]>
  • Loading branch information
nikitayutanov and osipov-mit authored Aug 16, 2023
1 parent 144d1f8 commit 457b4a2
Show file tree
Hide file tree
Showing 57 changed files with 53,603 additions and 1,011 deletions.
101 changes: 83 additions & 18 deletions .github/workflows/CI-CD-gear-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ on:
branches: [main]
paths:
- utils/gear-ui/**
- utils/vara-ui/**
push:
branches: [main]
paths:
- utils/gear-ui/**
- utils/vara-ui/**

jobs:
test:
gear-ui-test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
Expand All @@ -22,49 +24,112 @@ jobs:

- uses: actions/checkout@v2

- name: Install NodeJS 16.x
- name: Install NodeJS 18.x
uses: actions/[email protected]
with:
node-version: 16.x
node-version: 18.x

- name: Install dependencies
- name: "gear-ui: Install dependencies"
working-directory: utils/gear-ui
run: yarn install
run: npm install

- name: Build pkg
- name: "gear-ui: Build pkg"
working-directory: utils/gear-ui
run: yarn build
run: npm run build

- name: Run tests
- name: "gear-ui: Run tests"
working-directory: utils/gear-ui
run: yarn test
run: npm run test

vara-ui-build:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Cancel previous workflow runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2

- name: Install NodeJS 18.x
uses: actions/[email protected]
with:
node-version: 18.x

- name: "vara-ui: Install dependencies"
working-directory: utils/vara-ui
run: npm install

- name: "vara-ui: Build pkg"
working-directory: utils/vara-ui
run: npm run build


publish-to-npm:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Checkout"
uses: actions/checkout@v2

- name: "Check changed files"
shell: pwsh
id: check_file_changed
run: |
# Diff HEAD with the previous commit
$diff = git diff --name-only HEAD^ HEAD
# Check if a file under gear-ui has changed (added, modified, deleted)
$SourceDiffGearUI = $diff | Where-Object { $_ -match '^utils/gear-ui/' }
$HasDiffGearUI = $SourceDiffGearUI.Length -gt 0
$SourceDiffVaraUI = $diff | Where-Object { $_ -match '^utils/vara-ui/' }
$HasDiffVaraUI = $SourceDiffVaraUI.Length -gt 0
# Set the output
Write-Host "::set-output name=gearui_changed::$HasDiffGearUI"
Write-Host "::set-output name=varaui_changed::$HasDiffVaraUI"
- name: Use node 16.x
- name: Use node 18.x
uses: actions/[email protected]
with:
node-version: 16.x
node-version: 18.x

- name: Check package version
- name: "@gear-js/ui: Check pkg version"
uses: EndBug/version-check@v1
id: check
id: check_gear
with:
file-name: utils/gear-ui/package.json
file-url: https://unpkg.com/@gear-js/ui@latest/package.json
static-checking: localIsNew

- name: Publish
if: steps.check.outputs.changed == 'true'
- name: "@gear-js/vara-ui: Check pkg version"
uses: EndBug/version-check@v1
id: check_vara
with:
file-name: utils/vara-ui/package.json
file-url: https://unpkg.com/@gear-js/vara-ui@latest/package.json
static-checking: localIsNew

- name: "@gear-js/ui: Publish"
if: steps.check_gear.outputs.changed == 'true'
working-directory: utils/gear-ui
run: |
export token=$(printenv $(printenv GITHUB_ACTOR))
yarn install
yarn build
npm install
npm run build
npm config set //registry.npmjs.org/:_authToken=$token
npm publish
env:
osipov-mit: ${{ secrets.OSIPOV_NPM_TOKEN }}
nikitayutanov: ${{ secrets.YUTANOV_NPM_TOKEN }}

- name: "@gear-js/vara-ui: Publish"
if: steps.check_vara.outputs.changed == 'true'
working-directory: utils/vara-ui
run: |
export token=$(printenv $(printenv GITHUB_ACTOR))
npm install
npm run build
npm config set //registry.npmjs.org/:_authToken=$token
npm publish
env:
Expand Down
Loading

0 comments on commit 457b4a2

Please sign in to comment.