-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change package name and use asyncapi scope on npm (#14)
- Loading branch information
Showing
7 changed files
with
6,498 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Pull request testing | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
|
||
jobs: | ||
test_pr: | ||
if: github.event.pull_request.draft == false | ||
name: 'Testing pull request' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run linter | ||
run: npm run lint | ||
- name: Run tests | ||
run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
release: | ||
name: 'Release NPM, GitHub' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run tests | ||
run: npm test | ||
- name: Get version from package.json before release step | ||
id: initversion | ||
run: echo "::set-output name=version::$(npm run get-version --silent)" | ||
- name: Release to NPM and GitHub | ||
id: release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GIT_AUTHOR_NAME: asyncapi-bot | ||
GIT_AUTHOR_EMAIL: [email protected] | ||
GIT_COMMITTER_NAME: asyncapi-bot | ||
GIT_COMMITTER_EMAIL: [email protected] | ||
run: npm run release | ||
- name: Get version from package.json after release step | ||
id: extractver | ||
run: echo "::set-output name=version::$(npm run get-version --silent)" | ||
- name: Create Pull Request with updated package files | ||
if: steps.initversion.outputs.version != steps.extractver.outputs.version | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
commit-message: 'chore(release): ${{ steps.extractver.outputs.version }}' | ||
committer: asyncapi-bot <[email protected]> | ||
author: asyncapi-bot <[email protected]> | ||
title: 'chore(release): ${{ steps.extractver.outputs.version }}' | ||
body: 'Version bump in package.json and package-lock.json for release [${{ steps.extractver.outputs.version }}](https://github.com/${{github.repository}}/releases/tag/v${{ steps.extractver.outputs.version }})' | ||
branch: version-bump/${{ steps.extractver.outputs.version }} | ||
- name: Check if version changed # Version check based on package.json version number | ||
uses: EndBug/[email protected] | ||
id: check | ||
with: | ||
# we need to statically check that local version is now newer than the one in master | ||
file-url: https://raw.githubusercontent.com/${{github.repository}}/master/package.json | ||
static-checking: localIsNew | ||
- name: Publish information about the release to Twitter # tweet only if detected version change is not a patch | ||
if: steps.initversion.outputs.version != steps.extractver.outputs.version && steps.check.outputs.changed == 'true' && steps.check.outputs.type != 'patch' | ||
uses: m1ner79/[email protected] | ||
with: | ||
twitter_status: "Release ${{ steps.extractver.outputs.version }} for ${{github.repository}} is out in the wild 😱💪🍾🎂\n\nThank you for the contribution ${{ github.event.commits[0].author.name }} https://github.com/${{github.repository}}/releases/tag/v${{ steps.extractver.outputs.version }}" | ||
twitter_consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }} | ||
twitter_consumer_secret: ${{ secrets.TWITTER_CONSUMER_SECRET }} | ||
twitter_access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }} | ||
twitter_access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.