Skip to content

Commit

Permalink
chore: prepared for new global release workflow (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni authored Jan 26, 2021
1 parent d36388e commit c04f4e2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ overrides:
prefer-arrow-callback: 0
sonarjs/no-duplicate-string: 0
security/detect-object-injection: 0
security/detect-non-literal-fs-filename: 0
security/detect-non-literal-fs-filename: 0
32 changes: 32 additions & 0 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Bump package version in dependent repos

on:
#It cannot run on release event as when release is created then version is not yet bumped in package.json
#This means we cannot extract easily latest version and have a risk that package is not yet on npm
push:
branches:
- master

jobs:
bump:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Get version from package.json before release step
id: extractver
run: echo "::set-output name=version::$(npm run get:version --silent)"
- name: Get name of package from package.json
id: extractname
run: echo "::set-output name=packname::$(npm run get:name --silent)"
- if: startsWith(github.event.commits[0].message, 'chore(release):')
name: Bumping latest version of this package in other repositories
uses: derberg/org-projects-dependency-manager@v1
with:
github_token: ${{ secrets.GH_TOKEN }}
committer_username: asyncapi-bot
committer_email: [email protected]
#This is commit message and PR title for repos where this package is in dependencies
commit_message_prod: 'fix: update ${{ steps.extractname.outputs.packname }} to ${{ steps.extractver.outputs.version }} version'
#This is commit message and PR title for repos where this package is in devDependencies
commit_message_dev: 'chore: update ${{ steps.extractname.outputs.packname }} to ${{ steps.extractver.outputs.version }} version'
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@
"docs:markdown": "./node_modules/.bin/jsdoc2md lib/index.js -f lib/**/*.js > API.md",
"lint": "eslint --max-warnings 0 --config .eslintrc .",
"lint:fix": "eslint --max-warnings 0 --config .eslintrc . --fix",
"get-version": "echo $npm_package_version",
"get-name": "echo $npm_package_name",
"release": "semantic-release"
"get:version": "echo $npm_package_version",
"get:name": "echo $npm_package_name",
"release": "semantic-release",
"generate:assets": "npm run docs",
"bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION"
},
"publishConfig": {
"access": "public"
Expand Down

0 comments on commit c04f4e2

Please sign in to comment.