Skip to content

Commit

Permalink
fix(ci): fix failing ci
Browse files Browse the repository at this point in the history
  • Loading branch information
clukhei committed Jan 9, 2024
1 parent d89c463 commit 926e723
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 40 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/publish-latest.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# @format

name: Publish Latest Releases

on:
Expand All @@ -13,31 +11,29 @@ jobs:
if: startsWith(github.ref, 'refs/tags/sgds/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run lib:install
- run: npm run lib:build
- run: cd lib/sgds
- run: npm publish --tag latest --access public
- run: npm publish ./lib/sgds --tag latest --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-sgds-x-family:
if: startsWith(github.ref, 'refs/tags/sgds-x-family/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run sgds-x-family:install
- run: npm run sgds-x-family:build
- run: cd lib/sgds-x-family
- run: npm publish --tag latest --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
33 changes: 21 additions & 12 deletions .github/workflows/publish-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,45 @@ jobs:
if: startsWith(github.ref, 'refs/tags/sgds/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Set Tag env
run: echo "NPM_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run lib:install
- run: npm run lib:install
- run: npm run lib:build
- run: cd lib/sgds
- run: npm publish --tag alpha --access public
- run: npm publish ./lib/sgds --tag alpha --access public
if: contains(env.NPM_TAG, 'alpha')
- run: npm publish --tag beta --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish ./lib/sgds --tag beta --access public
if: contains(env.NPM_TAG, 'beta')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-sgds-x-family:
if: startsWith(github.ref, 'refs/tags/sgds-x-family/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Set Tag env
run: echo "NPM_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run sgds-x-family:install
- run: npm run sgds-x-family:build
- run: cd lib/sgds-x-family
- run: npm publish --tag alpha --access public
if: contains(env.NPM_TAG, 'alpha')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish --tag beta --access public
if: contains(env.NPM_TAG, 'beta')
env:
Expand Down
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@govtechsg/sgds",
"version": "1.0.0",
"description": "",
"name": "sgds",
"version": "0.0.0",
"description": "SGDS styling libraries monorepo",
"repository": {
"type": "git",
"url": "https://github.com/govtechsg/sgds.git"
Expand All @@ -10,17 +10,17 @@
"author": "Tey Liang Tai",
"main": "",
"scripts": {
"prepare": "husky install",
"portal:install": "cd portal && npm i && bundle install",
"lib:install": "cd lib/sgds && npm i",
"sgds-x-family:install": "cd lib/sgds-x-family && npm i",
"install": "concurrently \"npm i\" \"npm run lib:install\" \"npm run portal:install\" \"npm run sgds-x-family:install\"",
"lib:build": "cd lib/sgds && npm run build",
"portal:build": "cd portal && npm run build",
"build": "npm run lib:build && npm run portal:build",
"sgds-x-family:build": "cd lib/sgds-x-family && npm run build",
"portal:dev": "cd portal && npm run dev",
"react-select:dev": "cd lib/sgds-x-family && npm run react-select:dev"
"prepare": "husky install",
"portal:install": "cd portal && npm i && bundle install",
"lib:install": "cd lib/sgds && npm i",
"sgds-x-family:install": "cd lib/sgds-x-family && npm i",
"install": "concurrently \"npm run lib:install\" \"npm run portal:install\" \"npm run sgds-x-family:install\"",
"lib:build": "cd lib/sgds && npm run build",
"portal:build": "cd portal && npm run build",
"build": "npm run lib:build && npm run portal:build",
"sgds-x-family:build": "cd lib/sgds-x-family && npm run build",
"portal:dev": "cd portal && npm run dev",
"react-select:dev": "cd lib/sgds-x-family && npm run react-select:dev"
},
"devDependencies": {
"@commitlint/cli": "^17.0.3",
Expand Down

0 comments on commit 926e723

Please sign in to comment.