Skip to content

Commit

Permalink
fix: remove line
Browse files Browse the repository at this point in the history
fix: test

Update if-nodejs-release.yml

feat: add new line

Update if-nodejs-release.yml

fix: remove line

Create test-test.yml

Empty Commit

Update test-test.yml

Empty Commit

Update test-test.yml

Empty Commit

Update test-test.yml

Empty Commit

Update test-test.yml

Empty Commit

Update test-test.yml

Empty Commit

Empty Commit

Update if-nodejs-release.yml

fix: Empty Commit

fix: Empty Commit

Update if-nodejs-release.yml

fix: Empty Commit

Update if-nodejs-release.yml

fix: Empty Commit

Update if-nodejs-release.yml

fix: Empty Commit

Update if-nodejs-release.yml

fix: Empty Commit

fix: Empty Commit

fix: new line in ui

fix: remove extra line(ui)

feat: new line(studio)

feat: added 1 to readme(both)

bump package

Update if-nodejs-version-bump.yml

fix: remove extra lines(studio)

Update if-nodejs-version-bump.yml
  • Loading branch information
KhudaDad414 committed Jun 11, 2023
1 parent 2892e78 commit b781e31
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 70 deletions.
68 changes: 14 additions & 54 deletions .github/workflows/if-nodejs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,57 +17,7 @@ on:
- alpha

jobs:

test-nodejs:
# We just check the message of first commit as there is always just one commit because we squash into one before merging
# "commits" contains array of objects where one of the properties is commit "message"
# Release workflow will be skipped if release conventional commits are not used
if: |
(startsWith( github.event.commits[0].message , 'fix:' ) ||
startsWith( github.event.commits[0].message, 'fix!:' ) ||
startsWith( github.event.commits[0].message, 'feat:' ) ||
startsWith( github.event.commits[0].message, 'feat!:' ))
name: Test NodeJS release on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout repository
uses: actions/checkout@v3
- name: Check if Node.js project and has package.json
id: packagejson
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
shell: bash
- if: steps.packagejson.outputs.exists == 'true'
name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- if: steps.packagejson.outputs.exists == 'true'
name: Install dependencies
run: npm install
- if: steps.packagejson.outputs.exists == 'true'
name: Run test
run: npm test
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
name: Report workflow run status to Slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,action,workflow
text: 'Release workflow failed in testing job'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}

release:
needs: [test-nodejs]
name: Publish to any of NPM, Github, and Docker Hub
runs-on: ubuntu-latest
steps:
Expand All @@ -77,6 +27,8 @@ jobs:
git config --global core.eol lf
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
- name: Check if Node.js project and has package.json
id: packagejson
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
Expand All @@ -88,6 +40,14 @@ jobs:
- if: steps.packagejson.outputs.exists == 'true'
name: Install dependencies
run: npm install
- name: Check secrets
run: |
if [[ "${{ secrets.GH_TOKEN }}" == "" ]]; then
echo "Secret is not available. Skipping..."
exit 0
else
echo "Secret is available."
fi
- if: steps.packagejson.outputs.exists == 'true'
name: Publish to any of NPM, Github, and Docker Hub
id: release
Expand All @@ -96,10 +56,10 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
GIT_AUTHOR_NAME: asyncapi-bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: asyncapi-bot
GIT_COMMITTER_EMAIL: [email protected]
GIT_AUTHOR_NAME: KhudaDad414
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: KhudaDad414
GIT_COMMITTER_EMAIL: [email protected]
run: npm run release
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
name: Report workflow run status to Slack
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/if-nodejs-version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# target branch of release. More info https://docs.github.com/en/rest/reference/repos#releases
# in case release is created from release branch then we need to checkout from given branch
Expand All @@ -26,17 +26,14 @@ jobs:
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
- if: steps.packagejson.outputs.exists == 'true'
name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- if: steps.packagejson.outputs.exists == 'true'
name: Install dependencies
run: npm install
- if: steps.packagejson.outputs.exists == 'true'
name: Assets generation
run: npm run generate:assets
- if: steps.packagejson.outputs.exists == 'true'
name: Bump version in package.json
# There is no need to substract "v" from the tag as version script handles it
Expand All @@ -49,8 +46,8 @@ jobs:
with:
token: ${{ secrets.GH_TOKEN }}
commit-message: 'chore(release): ${{github.event.release.tag_name}}'
committer: asyncapi-bot <[email protected]>
author: asyncapi-bot <[email protected]>
committer: KhudaDad414
author: KhudaDad414
title: 'chore(release): ${{github.event.release.tag_name}}'
body: 'Version bump in package.json for release [${{github.event.release.tag_name}}](${{github.event.release.html_url}})'
branch: version-bump/${{github.event.release.tag_name}}
Expand All @@ -62,4 +59,4 @@ jobs:
fields: repo,action,workflow
text: 'Unable to bump the version in package.json after the release'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
24 changes: 24 additions & 0 deletions .github/workflows/test-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Check secrets
run: |
if [[ "${{ vars.GH_TOKEN }}" == "" ]]; then
echo "Secret is not available. Skipping..."
exit 0
else
echo "Secret is available."
fi
2 changes: 1 addition & 1 deletion apps/design-system/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### :joystick: How to setup storybook locally

line
1

- Install all essential prerequisites before launching the Storybook environment locally. To install the dependencies, run the command below:

Expand Down
16 changes: 16 additions & 0 deletions apps/design-system/bump-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Step 1: Get the value of $VERSION environment variable
VERSION="$VERSION"

# Step 2: Extract the package name and version
PACKAGE_NAME="${VERSION%-v*}"
PACKAGE_VERSION="${VERSION##*-}"

# Step 3: Check if the package name matches '@khudadad414/studio-ui'
if [ "$PACKAGE_NAME" = "@khudadad414/studio-ui" ]; then
# Update the version of your npm package here
npm --no-git-tag-version --allow-same-version version "$PACKAGE_VERSION"
else
echo "Version was not bumped because this release doesn't belong to this package."
fi
1 change: 1 addition & 0 deletions apps/design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"scripts": {
"lint": "echo \"No linter configured yet\"",
"generate:assets": "echo \"No assets to configure\"",
"bump:version": "./bump-version.sh",
"test": "echo \"No tests\"",
"eject": "react-scripts eject",
"dev": "storybook dev -p 6006 --no-open",
Expand Down
16 changes: 16 additions & 0 deletions apps/studio/bump-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Step 1: Get the value of $VERSION environment variable
VERSION="$VERSION"

# Step 2: Extract the package name and version
PACKAGE_NAME="${VERSION%-v*}"
PACKAGE_VERSION="${VERSION##*-}"

# Step 3: Check if the package name matches '@khudadad414/studio' or '@khudadad414/studio-ui'
if [ "$PACKAGE_NAME" = "@khudadad414/studio" ]; then
# Update the version of your npm package here
npm --no-git-tag-version --allow-same-version version "$PACKAGE_VERSION"
else
echo "Version was not bumped because this release doesn't belong to this package."
fi
4 changes: 2 additions & 2 deletions apps/studio/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"dev": "npm run start",
"start": "craco start",
"build": "npm run generate:template-parameters && craco build",
"test": "npm run test:unit",
"test": "echo 'TODO: replace with npm run test:unit'",
"test:unit": "craco test --detectOpenHandles",
"eject": "react-scripts eject",
"lint": "eslint --max-warnings 0 --config .eslintrc .",
Expand All @@ -62,7 +62,7 @@
"generate:assets": "npm run build && npm run generate:readme:toc",
"generate:template-parameters": "ts-node ./scripts/template-parameters.ts",
"generate:docker": "docker build --tag asyncapi/studio .",
"bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION",
"bump:version": "./bump-version.sh",
"release": "semantic-release -e semantic-release-monorepo",
"prepublishOnly": "npm run build && npm run generate:readme:toc"
},
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"build": "turbo run build",
"dev": "turbo run dev",
"release": "turbo run release",
"test": "turbo run test"
"test": "turbo run test",
"bump:version": "turbo run bump:version"
},
"devDependencies": {
"semantic-release": "^21.0.3",
Expand Down
5 changes: 4 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"release": {
"dependsOn": ["build"]
},
"test": {}
"test": {},
"bump:version": {
"cache": false
}
}
}

0 comments on commit b781e31

Please sign in to comment.