From 0e8b736a2964cf7f84034de43844cdd7d9d23482 Mon Sep 17 00:00:00 2001 From: Khuda Dad Nomani <32505158+KhudaDad414@users.noreply.github.com> Date: Tue, 28 Dec 2021 13:12:50 +0500 Subject: [PATCH] remove workflows --- .github/workflows/README.md | 44 ----- .../workflows/add-good-first-issue-labels.yml | 59 ------ ...d-ready-to-merge-or-do-not-merge-label.yml | 54 ------ .../automerge-for-humans-merging.yml | 32 ---- ...ns-remove-ready-to-merge-label-on-edit.yml | 35 ---- .github/workflows/automerge-orphans.yml | 63 ------- .github/workflows/automerge.yml | 59 ------ .github/workflows/autoupdate.yml | 28 --- .github/workflows/blackbox-testing.yml | 39 ---- .github/workflows/bump.yml | 32 ---- .github/workflows/coverall.yml | 25 --- .github/workflows/create-event-issue.yml | 63 ------- .github/workflows/deploy.yml | 16 -- .github/workflows/examples-pr-testing.yml | 36 ---- .../workflows/global-workflows-support.yml | 28 --- .../workflows/good-first-issue-closed.yaml | 55 ------ .../workflows/good-first-issue-created.yaml | 108 ----------- .github/workflows/help-command.yml | 43 ----- .github/workflows/if-go-pr-testing.yml | 58 ------ .github/workflows/if-nodejs-pr-testing.yml | 54 ------ .github/workflows/if-nodejs-release.yml | 80 --------- .github/workflows/if-nodejs-version-bump.yml | 48 ----- .../workflows/issue-pull-request-closed.yml | 60 ------- .../workflows/issue-pull-request-created.yml | 72 -------- .../workflows/issue-pull-request-upvote.yaml | 98 ---------- .../workflows/issues-prs-notifications.yml | 72 -------- .github/workflows/lint-pr-title.yml | 22 --- .github/workflows/lint.yml | 15 -- .github/workflows/new-spec-release.yml | 168 ------------------ .../workflows/pr-testing-with-generator.yml | 25 --- .../pr-testing-with-test-project.yml | 21 --- .github/workflows/publish-gh-pages.yml | 28 --- .github/workflows/release-announcements.yml | 76 -------- .github/workflows/release-docker.yml | 33 ---- .../workflows/release-wc-and-playground.yml | 82 --------- .github/workflows/release.yml | 27 --- .github/workflows/scope-welcome.yml | 60 ------- .github/workflows/sentiment-analysis.yml | 44 ----- .github/workflows/stale-issues-prs.yml | 42 ----- .../workflows/templates-list-validation.yml | 16 -- .github/workflows/test.yml | 20 --- .github/workflows/twitter-a-main-workflow.yml | 36 ---- .github/workflows/twitter-recurring-ideas.yml | 30 ---- .github/workflows/twitter-recurring-slack.yml | 28 --- .../workflows/update-docs-on-docs-commits.yml | 35 ---- .github/workflows/update-spec.yaml | 61 ------- .github/workflows/update-website.yml | 49 ----- .github/workflows/validate-tsc-members.yml | 67 ------- .../workflows/welcome-first-time-contrib.yml | 83 --------- 49 files changed, 2429 deletions(-) delete mode 100644 .github/workflows/README.md delete mode 100644 .github/workflows/add-good-first-issue-labels.yml delete mode 100644 .github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml delete mode 100644 .github/workflows/automerge-for-humans-merging.yml delete mode 100644 .github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml delete mode 100644 .github/workflows/automerge-orphans.yml delete mode 100644 .github/workflows/automerge.yml delete mode 100644 .github/workflows/autoupdate.yml delete mode 100644 .github/workflows/blackbox-testing.yml delete mode 100644 .github/workflows/bump.yml delete mode 100644 .github/workflows/coverall.yml delete mode 100644 .github/workflows/create-event-issue.yml delete mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/examples-pr-testing.yml delete mode 100644 .github/workflows/global-workflows-support.yml delete mode 100644 .github/workflows/good-first-issue-closed.yaml delete mode 100644 .github/workflows/good-first-issue-created.yaml delete mode 100644 .github/workflows/help-command.yml delete mode 100644 .github/workflows/if-go-pr-testing.yml delete mode 100644 .github/workflows/if-nodejs-pr-testing.yml delete mode 100644 .github/workflows/if-nodejs-release.yml delete mode 100644 .github/workflows/if-nodejs-version-bump.yml delete mode 100644 .github/workflows/issue-pull-request-closed.yml delete mode 100644 .github/workflows/issue-pull-request-created.yml delete mode 100644 .github/workflows/issue-pull-request-upvote.yaml delete mode 100644 .github/workflows/issues-prs-notifications.yml delete mode 100644 .github/workflows/lint-pr-title.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/new-spec-release.yml delete mode 100644 .github/workflows/pr-testing-with-generator.yml delete mode 100644 .github/workflows/pr-testing-with-test-project.yml delete mode 100644 .github/workflows/publish-gh-pages.yml delete mode 100644 .github/workflows/release-announcements.yml delete mode 100644 .github/workflows/release-docker.yml delete mode 100644 .github/workflows/release-wc-and-playground.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/scope-welcome.yml delete mode 100644 .github/workflows/sentiment-analysis.yml delete mode 100644 .github/workflows/stale-issues-prs.yml delete mode 100644 .github/workflows/templates-list-validation.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/twitter-a-main-workflow.yml delete mode 100644 .github/workflows/twitter-recurring-ideas.yml delete mode 100644 .github/workflows/twitter-recurring-slack.yml delete mode 100644 .github/workflows/update-docs-on-docs-commits.yml delete mode 100644 .github/workflows/update-spec.yaml delete mode 100644 .github/workflows/update-website.yml delete mode 100644 .github/workflows/validate-tsc-members.yml delete mode 100644 .github/workflows/welcome-first-time-contrib.yml diff --git a/.github/workflows/README.md b/.github/workflows/README.md deleted file mode 100644 index 2363c72..0000000 --- a/.github/workflows/README.md +++ /dev/null @@ -1,44 +0,0 @@ -## Event-Workflow Map - - - - - - - - - - - - - - - - - - - - - - -
When Pull Request Target:opened ready_for_review, reopened synchronize, edited labeled, unlocked, unlabeled
When Issues:opened reopened deleted, unlabeled, labeled, closed edited
When Push:master {} next, **-release
When Pull Request:opened reopened, ready_for_review, synchronize edited
When Pull Request Review:submitted edited
Schedules:At 12:00 AM
When Release:published
When Discussion:created
When Issue Comment:created, edited
When Pull Request Review Comment:created, edited
- -## Workflows - - | Workflow | Description | - | --- | --- | -| [Automerge release bump PR](hub/workflows/automerge.yml) | A short description about the workflow will appear here... | -| [Notify slack](hub/workflows/issues-prs-notifications.yml) | A short description about the workflow will appear here... | -| [Lint PR title](hub/workflows/lint-pr-title.yml) | A short description about the workflow will appear here... | -| [Welcome first time contributors](hub/workflows/welcome-first-time-contrib.yml) | A short description about the workflow will appear here... | -| [Deploy to Netlify](hub/workflows/deploy.yml) | A short description about the workflow will appear here... | -| [Sentiment Analysis](hub/workflows/sentiment-analysis.yml) | A short description about the workflow will appear here... | -| [Bump package version in dependent repos - if Node project](hub/workflows/bump.yml) | A short description about the workflow will appear here... | -| [Release - if Node project](hub/workflows/if-nodejs-release.yml) | A short description about the workflow will appear here... | -| [autoupdate](hub/workflows/autoupdate.yml) | A short description about the workflow will appear here... | -| [PR testing - if Go project](hub/workflows/if-go-pr-testing.yml) | A short description about the workflow will appear here... | -| [PR testing - if Node project](hub/workflows/if-nodejs-pr-testing.yml) | A short description about the workflow will appear here... | -| [Notify on failing automerge](hub/workflows/automerge-orphans.yml) | A short description about the workflow will appear here... | -| [Manage stale issues and PRs](hub/workflows/stale-issues-prs.yml) | A short description about the workflow will appear here... | -| [Version bump - if Node.js project](hub/workflows/if-nodejs-version-bump.yml) | A short description about the workflow will appear here... | -| [Announce releases in different channels](hub/workflows/release-announcements.yml) | A short description about the workflow will appear here... | diff --git a/.github/workflows/add-good-first-issue-labels.yml b/.github/workflows/add-good-first-issue-labels.yml deleted file mode 100644 index 3f377ba..0000000 --- a/.github/workflows/add-good-first-issue-labels.yml +++ /dev/null @@ -1,59 +0,0 @@ -#This workflow is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -name: Add 'Good First Issue', 'complexity/*' and 'area/*' labels -# Purpose of this workflow is to enable anyone to label issue with 'Good First Issue','complexity/*' and 'area/*' with a single command. -on: - issue_comment: - types: - - created - -jobs: - add-labels: - if: github.event.issue && github.event.issue.state != 'closed' - runs-on: ubuntu-latest - steps: - - name: Add label - if: contains(github.event.comment.body, '/good-first-issue') || contains(github.event.comment.body, '/gfi' ) - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GH_TOKEN }} - script: | - const complexities = ['1', '2', '3']; - const areas = ['javascript', 'typescript', 'java' , 'go', 'docs', 'ci-cd', 'design']; - const values = context.payload.comment.body.split(" "); - if(values.length != 3 || !complexities.includes(values[1]) || !areas.includes(values[2])){ - const message = `Hey @${context.payload.sender.login}, something is wrong with your command please use \`/help\` for help.` - - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: message - }) - } else { - - //remove complexity and areas if there are any before adding new labels; - const currentLabels = (await github.rest.issues.listLabelsOnIssue({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - })).data.map(label => label.name); - - const shouldBeRemoved = currentLabels.filter(label => (label.startsWith('area/') && !label.endsWith(values[2])) || (label.startsWith('complexity/') && !label.endsWith(values[1]))); - shouldBeRemoved.forEach(label => { - github.rest.issues.deleteLabel({ - owner: context.repo.owner, - repo: context.repo.repo, - name: label, - }); - }); - - //add new labels - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['good first issue', `complexity/${values[1]}`, `area/${values[2]}`] - }); - } diff --git a/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml b/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml deleted file mode 100644 index 7953d3a..0000000 --- a/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml +++ /dev/null @@ -1,54 +0,0 @@ -#This workflow is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -#Purpose of this workflow is to enable anyone to label PR with `ready-to-merge` and `do-not-merge` labels to get stuff merged or blocked from merging -name: Add ready-to-merge or do-not-merge label # if proper comment added - -on: - issue_comment: - types: - - created - -jobs: - parse-comment-and-add-ready: # for handling cases when you want to mark as ready to merge - if: github.event.issue.pull_request && github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot' - runs-on: ubuntu-latest - steps: - - name: Check if PR is draft # such info is not available in the context of issue_comment event - uses: actions/github-script@v5 - id: checkDraft - with: - result-encoding: string - script: | - const prDetailsUrl = context.payload.issue.pull_request.url; - const response = await github.request(prDetailsUrl); - return response.data.draft; - - name: Add label - if: steps.checkDraft.outputs.result == 'false' && (contains(github.event.comment.body, '/ready-to-merge') || contains(github.event.comment.body, '/rtm' )) - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GH_TOKEN }} - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['ready-to-merge'] - }) - - parse-comment-and-add-block: # for handling cases when you want to mark as do-not-merge - if: github.event.issue.pull_request && github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot' - runs-on: ubuntu-latest - steps: - - name: Add label - if: contains(github.event.comment.body, '/do-not-merge') || contains(github.event.comment.body, '/dnm' ) - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GH_TOKEN }} - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['do-not-merge'] - }) diff --git a/.github/workflows/automerge-for-humans-merging.yml b/.github/workflows/automerge-for-humans-merging.yml deleted file mode 100644 index b91ef75..0000000 --- a/.github/workflows/automerge-for-humans-merging.yml +++ /dev/null @@ -1,32 +0,0 @@ -#This workflow is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -#Purpose of this workflow is to allow people to merge PR without a need of maintainer doing it. If all checks are in place (including maintainers approval) - JUST MERGE IT! -name: Automerge For Humans - -on: - pull_request_target: - types: - - labeled - - unlabeled - - synchronize - - opened - - edited - - ready_for_review - - reopened - - unlocked - -jobs: - automerge-for-humans: - if: github.event.pull_request.draft == false && (github.event.pull_request.user.login != 'asyncapi-bot' || github.event.pull_request.user.login != 'dependabot[bot]' || github.event.pull_request.user.login != 'dependabot-preview[bot]') #it runs only if PR actor is not a bot, at least not a bot that we know - runs-on: ubuntu-latest - steps: - - name: Automerge PR - uses: pascalgn/automerge-action@v0.14.3 - env: - GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}" - MERGE_LABELS: "!do-not-merge,ready-to-merge" - MERGE_METHOD: "squash" - MERGE_COMMIT_MESSAGE: "pull-request-title" - MERGE_RETRIES: "20" - MERGE_RETRY_SLEEP: "30000" \ No newline at end of file diff --git a/.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml b/.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml deleted file mode 100644 index 3fe9157..0000000 --- a/.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml +++ /dev/null @@ -1,35 +0,0 @@ -#This workflow is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -# Defence from evil contributor that after adding `ready-to-merge` all suddenly makes evil commit or evil change in PR title -# Label is removed once above action is detected -name: Remove ready-to-merge label - -on: - pull_request_target: - types: - - synchronize - - edited - -jobs: - remove-ready-label: - runs-on: ubuntu-latest - steps: - - name: Remove label - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GH_TOKEN }} - script: | - const labelToRemove = 'ready-to-merge'; - const labels = context.payload.pull_request.labels; - - const isLabelPresent = labels.some(label => label.name === labelToRemove) - - if(!isLabelPresent) return; - - github.rest.issues.removeLabel({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - name: labelToRemove - }) diff --git a/.github/workflows/automerge-orphans.yml b/.github/workflows/automerge-orphans.yml deleted file mode 100644 index 8b8c6c2..0000000 --- a/.github/workflows/automerge-orphans.yml +++ /dev/null @@ -1,63 +0,0 @@ -#This action is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -name: 'Notify on failing automerge' - -on: - schedule: - - cron: "0 0 * * *" - -jobs: - identify-orphans: - name: Find orphans and notify - runs-on: ubuntu-latest - steps: - - name: Get list of orphans - uses: actions/github-script@v3 - id: orphans - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const query = `query($owner:String!, $name:String!) { - repository(owner:$owner, name:$name){ - pullRequests(first: 100, states: OPEN){ - nodes{ - title - url - author { - resourcePath - } - } - } - } - }`; - const variables = { - owner: context.repo.owner, - name: context.repo.repo - }; - const { repository: { pullRequests: { nodes } } } = await github.graphql(query, variables); - - let orphans = nodes.filter( (pr) => pr.author.resourcePath === '/asyncapi-bot' || pr.author.resourcePath === '/apps/dependabot') - - if (orphans.length) { - core.setOutput('found', 'true'); - //Yes, this is very naive approach to assume there is just one PR causing issues, there can be a case that more PRs are affected the same day - //The thing is that handling multiple PRs will increase a complexity in this PR that in my opinion we should avoid - //The other PRs will be reported the next day the action runs, or person that checks first url will notice the other ones - core.setOutput('url', orphans[0].url); - core.setOutput('title', orphans[0].title); - } - - if: steps.orphans.outputs.found == 'true' - name: Convert markdown to slack markdown - uses: LoveToKnow/slackify-markdown-action@v1.0.0 - id: issuemarkdown - with: - text: "-> [${{steps.orphans.outputs.title}}](${{steps.orphans.outputs.url}})" - - if: steps.orphans.outputs.found == 'true' - name: Send info about orphan to slack - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} - SLACK_TITLE: 🚨 Not merged PR that should be automerged 🚨 - SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} - MSG_MINIMAL: true \ No newline at end of file diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml deleted file mode 100644 index 4b41128..0000000 --- a/.github/workflows/automerge.yml +++ /dev/null @@ -1,59 +0,0 @@ - # This action is centrally managed in https://github.com/asyncapi/.github/ - # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo. - -name: Automerge release bump PR - -on: - pull_request_target: - types: - - labeled - - unlabeled - - synchronize - - opened - - edited - - ready_for_review - - reopened - - unlocked - pull_request_review: - types: - - submitted - -jobs: - - autoapprove: - if: github.event.pull_request.draft == false && (github.event.pull_request.user.login == 'asyncapi-bot' || github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'dependabot-preview[bot]') && !contains(github.event.pull_request.labels.*.name, 'released') - runs-on: ubuntu-latest - steps: - - name: Autoapproving - uses: hmarr/auto-approve-action@v2 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - name: Label autoapproved - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GH_TOKEN }} - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['autoapproved'] - }) - - - automerge: - needs: [autoapprove] - if: github.event.pull_request.user.login == 'asyncapi-bot' || github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'dependabot-preview[bot]' - runs-on: ubuntu-latest - steps: - - name: Automerging - uses: pascalgn/automerge-action@v0.13.0 - env: - GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}" - GITHUB_LOGIN: asyncapi-bot - MERGE_LABELS: "" - MERGE_METHOD: "squash" - MERGE_COMMIT_MESSAGE: "pull-request-title" - MERGE_RETRIES: "20" - MERGE_RETRY_SLEEP: "30000" diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml deleted file mode 100644 index 4146312..0000000 --- a/.github/workflows/autoupdate.yml +++ /dev/null @@ -1,28 +0,0 @@ -#This action is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -#This workflow is designed to work with: -# - autoapprove and automerge workflows for dependabot and asyncapibot. -# - special release branches that we from time to time create in upstream repos. If we open up PRs for them from the very beginning of the release, the release branch will constantly update with new things from the destination branch they are opened against - -# It uses GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch. -#Autoupdating to latest destination branch works only in the context of upstream repo and not forks - -name: autoupdate - -on: - push: {} - -jobs: - - autoupdate: - runs-on: ubuntu-latest - steps: - - name: Autoupdating - uses: docker://chinthakagodawita/autoupdate-action:v1 - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - PR_FILTER: "labelled" - PR_LABELS: "autoapproved" - PR_READY_STATE: "ready_for_review" - MERGE_CONFLICT_ACTION: "ignore" diff --git a/.github/workflows/blackbox-testing.yml b/.github/workflows/blackbox-testing.yml deleted file mode 100644 index 6888b5c..0000000 --- a/.github/workflows/blackbox-testing.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Blackbox testing (Stay Awhile and Listen) -on: - push: - pull_request: - types: [opened, reopened, synchronize, ready_for_review] -jobs: - test: - if: github.event.pull_request.draft == false - name: BlackBox testing ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: 14 - - name: Build library - run: npm install && npm run build - - uses: actions/setup-java@v2 - with: - distribution: 'adopt' - java-version: '11' - - if: matrix.os != 'windows-latest' - name: Setup dotnet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '5.0.x' - - if: matrix.os == 'windows-latest' - name: Setup csc.exe - uses: yoavain/Setup-CSC@v7 - - uses: actions/setup-go@v2 - with: - go-version: '1.16.8' - - name: Test output - run: npm run test:blackbox \ No newline at end of file diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml deleted file mode 100644 index 66af7a5..0000000 --- a/.github/workflows/bump.yml +++ /dev/null @@ -1,32 +0,0 @@ -#This action is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -#Purpose of this action is to update npm package in libraries that use it. It is like dependabot for asyncapi npm modules only. -#It runs in a repo after merge of release commit and searches for other packages that use released package. Every found package gets updated with lates version - -name: Bump package version in dependent repos - if Node project - -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: 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" - - if: steps.packagejson.outputs.exists == 'true' && startsWith(github.event.commits[0].message, 'chore(release):') - name: Bumping latest version of this package in other repositories - uses: derberg/npm-dependency-manager-for-your-github-org@v3 - with: - github_token: ${{ secrets.GH_TOKEN }} - committer_username: asyncapi-bot - committer_email: info@asyncapi.io - repos_to_ignore: html-template #this is temporary until react component releases 1.0, then it can be removed diff --git a/.github/workflows/coverall.yml b/.github/workflows/coverall.yml deleted file mode 100644 index a4e424e..0000000 --- a/.github/workflows/coverall.yml +++ /dev/null @@ -1,25 +0,0 @@ -on: - push: - branches: - - master - pull_request: - types: [opened, reopened, synchronize, ready_for_review] -name: Check test coverage -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: 14 - - name: npm install, run test - run: | - npm install - npm run test - - name: Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/create-event-issue.yml b/.github/workflows/create-event-issue.yml deleted file mode 100644 index 5026bf7..0000000 --- a/.github/workflows/create-event-issue.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Create community event issue - -on: - workflow_dispatch: - inputs: - time: - description: 'Info about meeting hour in UTC time zone, like: 8AM' - required: true - everytimezone: - description: 'Link that points to specific time when meeting happens so others can translate it to their time zones, like: https://everytimezone.com/s/182f3172' - required: true - date: - description: 'Date in a form like: Tuesday October 26 2021' - required: true - type: - description: 'Is it "sig" or "contributor_first" meeting' - required: true - -jobs: - - setup-sig-meeting: - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - name: Setup SIG meeting - runs-on: ubuntu-latest - if: github.event.inputs.type == 'sig' - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Create issue content - uses: actions/github-script@v4 - with: - script: | - const { writeFileSync } = require('fs'); - const { getMeetingIssueContent } = require('./.github/workflows/event_issue_templates/sig.js'); - - const issueContent = getMeetingIssueContent('${{ github.event.inputs.time }}', '${{ github.event.inputs.everytimezone }}'); - - writeFileSync('content.md', issueContent, { encoding: 'utf8'}); - - name: Create issue with meeting details - run: gh issue create -l meeting -t "Community SIG Meeting, ${{ github.event.inputs.time }} UTC ${{ github.event.inputs.date }}" -F content.md - - setup-contributor-first-meeting: - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - name: Setup Community-first meeting - runs-on: ubuntu-latest - if: github.event.inputs.type == 'contributor_first' - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Create issue content - uses: actions/github-script@v4 - with: - script: | - const { writeFileSync } = require('fs'); - const { getMeetingIssueContent } = require('./.github/workflows/event_issue_templates/contributor-first.js'); - - const issueContent = getMeetingIssueContent('${{ github.event.inputs.time }}', '${{ github.event.inputs.everytimezone }}'); - - writeFileSync('content.md', issueContent, { encoding: 'utf8'}); - - name: Create issue with meeting details - run: gh issue create -l meeting -t "Contributor-first Meeting, ${{ github.event.inputs.time }} UTC ${{ github.event.inputs.date }}" -F content.md diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 7219ee2..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Deploy to Netlify -on: - issues: - types: [opened, deleted, closed, reopened, labeled, unlabeled] - -jobs: - publish: - runs-on: ubuntu-latest - - steps: - - name: Trigger deploy on Netlify - run: | - curl -X POST "https://api.netlify.com/api/v1/sites/$NETLIFY_SITE_ID/builds" -H "Authorization: Bearer $NETLIFY_AUTH_TOKEN" - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} diff --git a/.github/workflows/examples-pr-testing.yml b/.github/workflows/examples-pr-testing.yml deleted file mode 100644 index 2a148d1..0000000 --- a/.github/workflows/examples-pr-testing.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Examples PR testing - -on: - pull_request: - types: [opened, reopened, synchronize, ready_for_review] - -jobs: - test: - if: github.event.pull_request.draft == false - name: ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '3.1.x' - - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: 14 - - name: Install dependencies - id: first-installation - run: npm install --loglevel verbose - continue-on-error: true - - name: Clear NPM cache and install deps again - run: | - npm cache clean --force - npm install --loglevel verbose - - name: Generate examples - run: npm run generate:examples - - name: Build examples - run: npm run build:examples diff --git a/.github/workflows/global-workflows-support.yml b/.github/workflows/global-workflows-support.yml deleted file mode 100644 index 03b4877..0000000 --- a/.github/workflows/global-workflows-support.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Global workflow to rule them all - -on: - push: - branches: [ master ] - workflow_dispatch: {} - -jobs: - - replicate_changes: - - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Replicating global workflows - uses: derberg/global-workflows-support@v0.2.0 - with: - github_token: ${{ secrets.GH_TOKEN }} - # this action will not replicate to other repos workflows listed here - files_to_ignore: global-workflows-support.yml - # workflows will not be replicated to repos listed here - repos_to_ignore: shape-up-process,marketing,training,glee-hello-world - committer_username: asyncapi-bot - committer_email: info@asyncapi.io - # it is both, commit message and PR title - commit_message: "ci: update global workflows" diff --git a/.github/workflows/good-first-issue-closed.yaml b/.github/workflows/good-first-issue-closed.yaml deleted file mode 100644 index ae39d74..0000000 --- a/.github/workflows/good-first-issue-closed.yaml +++ /dev/null @@ -1,55 +0,0 @@ -name: Remove from Good First Issue -on: - issues: - types: - - closed -jobs: - remove-from-good-first-issues: - if: contains(github.event.issue.labels.*.name, 'good first issue') - runs-on: ubuntu-latest - steps: - - name: Get the item id - env: - GITHUB_TOKEN: ${{secrets.GH_TOKEN_ORG_ADMIN}} - ORGANIZATION: asyncapi - PROJECT_NUMBER: 4 - ISSUE_ID: ${{ github.event.issue.node_id }} - run: | - gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' - query($org: String!, $number: Int!) { - organization(login: $org){ - projectNext(number: $number) { - id - items(first:100) { - nodes { - id - content { - ... on Issue { - id - } - } - } - } - } - } - }' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > item_ids.json - - echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' item_ids.json) >> $GITHUB_ENV - echo 'ITEM_ID='$(jq '.data.organization.projectNext.items.nodes[] | select(.content.id=="'$ISSUE_ID'") | .id' item_ids.json) >> $GITHUB_ENV - - name: Remove Issue From Projects - env: - GITHUB_TOKEN: ${{secrets.GH_TOKEN_ORG_ADMIN}} - run: | - item_id="$( gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' - mutation($project:ID!, $item_id:ID!) { - deleteProjectNextItem( - input: { - projectId: $project - itemId: $item_id - } - ) { - deletedItemId - } - }' -f project=$PROJECT_ID -f item_id=$ITEM_ID --jq '.data.deleteProjectNextItem.projectNextItem.deletedItemId')" - - echo 'Item with ID: '$item_id' Has been removed.' diff --git a/.github/workflows/good-first-issue-created.yaml b/.github/workflows/good-first-issue-created.yaml deleted file mode 100644 index 3030c37..0000000 --- a/.github/workflows/good-first-issue-created.yaml +++ /dev/null @@ -1,108 +0,0 @@ -name: Add to Good First Issue -on: - issues: - types: - - labeled - - reopened -jobs: - add-to-good-first-issues: - env: - GITHUB_TOKEN: ${{secrets.GH_TOKEN_ORG_ADMIN}} - ISSUE_ID: ${{ github.event.issue.node_id }} - PROJECT_ID: PN_kwDOAPpDts0UBA - if: contains(github.event.issue.labels.*.name, 'good first issue') - runs-on: ubuntu-latest - steps: - - name: Add Issue to project - run: | - gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' - mutation($project:ID!, $pr:ID!) { - addProjectNextItem(input: {projectId: $project, contentId: $pr}) { - projectNextItem { - id - project { - fields(last:10) { - nodes { - id - name - settings - } - } - } - } - } - }' -f project=$PROJECT_ID -f pr=$ISSUE_ID > project_data.json - - echo 'ITEM_ID='$(jq '.data.addProjectNextItem.projectNextItem.id' project_data.json) >> $GITHUB_ENV - echo 'AREA_FIELD_ID='$(jq '.data.addProjectNextItem.projectNextItem.project.fields.nodes[] | select(.name== "Area") | .id' project_data.json) >> $GITHUB_ENV - echo 'COMPLEXITY_FIELD_ID='$(jq '.data.addProjectNextItem.projectNextItem.project.fields.nodes[] | select(.name== "Complexity") | .id' project_data.json) >> $GITHUB_ENV - - name: Is complexity easy - if: contains(github.event.issue.labels.*.name, 'complexity/easy') - run: | - echo 'COMPLEXITY_OPTION_ID='$(jq '.data.addProjectNextItem.projectNextItem.project.fields.nodes[] | select(.name== "Complexity") |.settings | fromjson.options[] | select(.name=="Easy") |.id' project_data.json) >> $GITHUB_ENV - - - name: Is complexity moderate - if: contains(github.event.issue.labels.*.name, 'complexity/moderate') - run: | - echo 'COMPLEXITY_OPTION_ID='$(jq '.data.addProjectNextItem.projectNextItem.project.fields.nodes[] | select(.name== "Complexity") |.settings | fromjson.options[] | select(.name=="Moderate") |.id' project_data.json) >> $GITHUB_ENV - - - name: Is complexity hard - if: contains(github.event.issue.labels.*.name, 'complexity/hard') - run: | - echo 'COMPLEXITY_OPTION_ID='$(jq '.data.addProjectNextItem.projectNextItem.project.fields.nodes[] | select(.name== "Complexity") |.settings | fromjson.options[] | select(.name=="Hard") |.id' project_data.json) >> $GITHUB_ENV - - - name: Is area typescript - if: contains(github.event.issue.labels.*.name, 'area/typescript') - run: | - echo 'AREA_OPTION_ID='$(jq '.data.addProjectNextItem.projectNextItem.project.fields.nodes[] | select(.name== "Area") |.settings | fromjson.options[] | select(.name=="Typescript") |.id' project_data.json) >> $GITHUB_ENV - - - name: Is area javascript - if: contains(github.event.issue.labels.*.name, 'area/javascript') - run: | - echo 'AREA_OPTION_ID='$(jq '.data.addProjectNextItem.projectNextItem.project.fields.nodes[] | select(.name== "Area") |.settings | fromjson.options[] | select(.name=="Javascript") |.id' project_data.json) >> $GITHUB_ENV - - - name: Is area markdown - if: contains(github.event.issue.labels.*.name, 'area/markdown') - run: | - echo 'AREA_OPTION_ID='$(jq '.data.addProjectNextItem.projectNextItem.project.fields.nodes[] | select(.name== "Area") |.settings | fromjson.options[] | select(.name=="Markdown") |.id' project_data.json) >> $GITHUB_ENV - - - name: Is area Github Actions - if: contains(github.event.issue.labels.*.name, 'area/github actions') - run: | - echo 'AREA_OPTION_ID='$(jq '.data.addProjectNextItem.projectNextItem.project.fields.nodes[] | select(.name== "Area") |.settings | fromjson.options[] | select(.name=="GithubActions") |.id' project_data.json) >> $GITHUB_ENV - - - - name: Add the data to the projects - if: ${{env.COMPLEXITY_OPTION_ID && env.AREA_OPTION_ID}} - run: | - gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' - mutation ( - $project: ID! - $item: ID! - $area_field: ID! - $area_value: String! - $complexity_field: ID! - $complexity_value: String! - ) { - set_complexity: updateProjectNextItemField(input: { - projectId: $project - itemId: $item - fieldId: $complexity_field - value: $complexity_value - }) { - projectNextItem { - id - } - } - set_area: updateProjectNextItemField(input: { - projectId: $project - itemId: $item - fieldId: $area_field - value: $area_value - }) { - projectNextItem { - id - } - } - }' -f project=$PROJECT_ID -f item=$ITEM_ID -f complexity_field=$COMPLEXITY_FIELD_ID -f complexity_value=${{ env.COMPLEXITY_OPTION_ID }} -f area_field=$AREA_FIELD_ID -f area_value=${{ env.AREA_OPTION_ID }} --silent - diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml deleted file mode 100644 index 486ef9f..0000000 --- a/.github/workflows/help-command.yml +++ /dev/null @@ -1,43 +0,0 @@ -#This workflow is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -name: Create help comment - -on: - issue_comment: - types: - - created - -jobs: - create_help_comment_pr: - if: github.event.issue.pull_request && contains(github.event.comment.body, '/help') - runs-on: ubuntu-latest - steps: - - uses: actions-ecosystem/action-create-comment@v1 - with: - github_token: ${{ secrets.GH_TOKEN }} - body: | - Hello, @${{ github.actor }}! πŸ‘‹πŸΌ - - I'm Genie from the magic lamp. Looks like somebody needs a hand! πŸ†˜ - - At the moment the following comments are supported in pull requests: - - - `/ready-to-merge` or `/rtm` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added - - `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added - create_help_comment_issue: - if: ${{ !github.event.issue.pull_request && contains(github.event.comment.body, '/help') }} - runs-on: ubuntu-latest - steps: - - uses: actions-ecosystem/action-create-comment@v1 - with: - github_token: ${{ secrets.GH_TOKEN }} - body: | - Hello, @${{ github.actor }}! πŸ‘‹πŸΌ - - I'm Genie from the magic lamp. Looks like somebody needs a hand! πŸ†˜ - - At the moment the following comments are supported in issues: - - - `/good-first-issue {1|2|3} {javascript | typescript | java | go | docs | design | ci-cd} ` or `/gfi {1|2|3} {javascript | typescript | java | go | docs | design | ci-cd} ` - label an issue as a `good first issue`, Where the first option is the complexity of the issue (1 least complex, 3 most complex) and the second option is the area. - example: `/gfi 2 javascript` or `/good-first-issue 1 typescript` diff --git a/.github/workflows/if-go-pr-testing.yml b/.github/workflows/if-go-pr-testing.yml deleted file mode 100644 index 4a4078f..0000000 --- a/.github/workflows/if-go-pr-testing.yml +++ /dev/null @@ -1,58 +0,0 @@ -#This action is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo -#It does magic only if there is go.mod file in the root of the project -name: PR testing - if Go project - -on: - pull_request: - types: [opened, reopened, synchronize, ready_for_review] - -jobs: - lint: - if: github.event.pull_request.draft == false - name: lint - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Check if Go project and has go.mod - id: gomod - run: test -e ./go.mod && echo "::set-output name=exists::true" || echo "::set-output name=exists::false" - shell: bash - - if: steps.gomod.outputs.exists == 'true' - name: Setup Go - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.16 - - if: steps.gomod.outputs.exists == 'true' - name: golangci-lint - uses: golangci/golangci-lint-action@v2 # golangci-lint version extracted from go.mod. `latest` if missing. - with: - skip-go-installation: true # we wanna control the version of Go in use - - test: - if: github.event.pull_request.draft == false - name: ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Check if Go project and has go.mod - id: gomod - run: test -e ./go.mod && echo "::set-output name=exists::true" || echo "::set-output name=exists::false" - shell: bash - - if: steps.gomod.outputs.exists == 'true' - name: Setup Go - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.16 - - if: steps.gomod.outputs.exists == 'true' - name: Build - run: go build -v ./... - - if: steps.gomod.outputs.exists == 'true' - name: Test - run: go test -v ./... - diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml deleted file mode 100644 index 812e73a..0000000 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ /dev/null @@ -1,54 +0,0 @@ -#This action is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo -#It does magic only if there is package.json file in the root of the project -name: PR testing - if Node project - -on: - pull_request: - types: [opened, reopened, synchronize, ready_for_review] - -jobs: - test: - if: github.event.pull_request.draft == false - name: ${{ 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@v2 - - 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@v2 - with: - node-version: 14 - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - - if: steps.packagejson.outputs.exists == 'true' - name: Install dependencies - id: first-installation - run: npm install --loglevel verbose - continue-on-error: true - - if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true' - name: Clear NPM cache and install deps again - run: | - npm cache clean --force - npm install --loglevel verbose - - if: steps.packagejson.outputs.exists == 'true' - name: Test - run: npm test - - if: steps.packagejson.outputs.exists == 'true' - name: Run linter - run: npm run lint - - if: steps.packagejson.outputs.exists == 'true' - name: Run release assets generation to make sure PR does not break it - run: npm run generate:assets diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml deleted file mode 100644 index 71f7607..0000000 --- a/.github/workflows/if-nodejs-release.yml +++ /dev/null @@ -1,80 +0,0 @@ -#This action is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo -#It does magic only if there is package.json file in the root of the project -name: Release - if Node project - -on: - push: - branches: - - master - # below lines are not enough to have release supported for these branches - # make sure configuration of `semantic-release` package mentiones these branches - - next - - '**-release' - -jobs: - - test: - name: Test 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@v2 - - 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@v2 - with: - node-version: 14 - 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 - - release: - needs: test - name: Publish to NPM and GitHub - runs-on: ubuntu-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@v2 - - 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" - - if: steps.packagejson.outputs.exists == 'true' - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: 14 - - if: steps.packagejson.outputs.exists == 'true' - name: Install dependencies - run: npm install - - if: steps.packagejson.outputs.exists == 'true' - 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: info@asyncapi.io - GIT_COMMITTER_NAME: asyncapi-bot - GIT_COMMITTER_EMAIL: info@asyncapi.io - run: npm run release diff --git a/.github/workflows/if-nodejs-version-bump.yml b/.github/workflows/if-nodejs-version-bump.yml deleted file mode 100644 index c1f5c86..0000000 --- a/.github/workflows/if-nodejs-version-bump.yml +++ /dev/null @@ -1,48 +0,0 @@ -#This action is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo -#It does magic only if there is package.json file in the root of the project -name: Version bump - if Node.js project - -on: - release: - types: - - published - -jobs: - version_bump: - name: Generate assets and bump - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - 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 - # if @semantic-release/github is used to publish, the minimum version is 7.2.0 for proper working - ref: ${{ github.event.release.target_commitish }} - - 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" - - 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 - # When adding "bump:version" script in package.json, make sure no tags are added by default (--no-git-tag-version) as they are already added by release workflow - # When adding "bump:version" script in package.json, make sure --allow-same-version is set in case someone forgot and updated package.json manually and we want to avoide this action to fail and raise confusion - run: VERSION=${{github.event.release.tag_name}} npm run bump:version - - if: steps.packagejson.outputs.exists == 'true' - name: Create Pull Request with updated asset files including package.json - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.GH_TOKEN }} - commit-message: 'chore(release): ${{github.event.release.tag_name}}' - committer: asyncapi-bot - author: asyncapi-bot - 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}} \ No newline at end of file diff --git a/.github/workflows/issue-pull-request-closed.yml b/.github/workflows/issue-pull-request-closed.yml deleted file mode 100644 index 3726029..0000000 --- a/.github/workflows/issue-pull-request-closed.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Remove from Hot -on: - pull_request_target: - types: - - closed - issues: - types: - - closed - - deleted -jobs: - remove-from-hot: - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{secrets.GH_TOKEN_ORG_ADMIN}} - steps: - - name: Get the item id - env: - ORGANIZATION: asyncapi - PROJECT_NUMBER: 9 - ISSUE_ID: ${{ github.event.issue.node_id || github.event.pull_request.node_id }} - run: | - gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' - query($org: String!, $number: Int!) { - organization(login: $org){ - projectNext(number: $number) { - id - items(first:100) { - nodes { - id - content { - ... on Issue { - id - } - ... on PullRequest { - id - } - } - } - } - } - } - }' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > item_ids.json - echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' item_ids.json) >> $GITHUB_ENV - echo 'ITEM_ID='$(jq '.data.organization.projectNext.items.nodes[] | select(.content.id=="'$ISSUE_ID'") | .id' item_ids.json) >> $GITHUB_ENV - - - name: Remove Issue/PR From Projects - run: | - item_id="$( gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' - mutation($project:ID!, $item_id:ID!) { - deleteProjectNextItem( - input: { - projectId: $project - itemId: $item_id - } - ) { - deletedItemId - } - }' -f project=$PROJECT_ID -f item_id=$ITEM_ID --jq '.data.deleteProjectNextItem.projectNextItem.deletedItemId')" - - echo 'Item with ID: '$item_id' Has been removed.' diff --git a/.github/workflows/issue-pull-request-created.yml b/.github/workflows/issue-pull-request-created.yml deleted file mode 100644 index a5fc5dc..0000000 --- a/.github/workflows/issue-pull-request-created.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Add to Hot Issues/PRs -on: - pull_request_target: - types: - - opened - - reopened - issues: - types: - - opened - - reopened -jobs: - add-to-hot: - runs-on: ubuntu-latest - env: - PROJECT_ID: PN_kwDOAPpDts0fAA - GITHUB_TOKEN: ${{secrets.GH_TOKEN_ORG_ADMIN}} - steps: - - name: Add Issue/PR to projects - env: - ISSUE_ID: ${{ github.event.issue.node_id || github.event.pull_request.node_id }} - PROJECT_ID: PN_kwDOAPpDts0fAA - run: | - item_id="$( gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' - mutation($project:ID!, $pr:ID!) { - addProjectNextItem(input: {projectId: $project, contentId: $pr}) { - projectNextItem { - id - } - } - }' -f project=$PROJECT_ID -f pr=$ISSUE_ID --jq '.data.addProjectNextItem.projectNextItem.id')" - - echo 'ITEM_ID='$item_id >> $GITHUB_ENV - - - name: Get date - run: echo "DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV - - - name: Set date - env: - DATE_FIELD_ID: MDE2OlByb2plY3ROZXh0RmllbGQ2MDIyOA== - INTERACTION_FIELD_ID: MDE2OlByb2plY3ROZXh0RmllbGQ2MDIzMA== - INTERACTION_FIELD_VALUE: 0 - run: | - gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' - mutation ( - $project: ID! - $item: ID! - $interaction_field: ID! - $interaction_value: String! - $date_field: ID! - $date_value: String! - ) { - set_interaction: updateProjectNextItemField(input: { - projectId: $project - itemId: $item - fieldId: $interaction_field - value: $interaction_value - }) { - projectNextItem { - id - } - } - set_date_posted: updateProjectNextItemField(input: { - projectId: $project - itemId: $item - fieldId: $date_field - value: $date_value - }) { - projectNextItem { - id - } - } - }' -f project=$PROJECT_ID -f item=$ITEM_ID -f interaction_field=$INTERACTION_FIELD_ID -f interaction_value=$INTERACTION_FIELD_VALUE -f date_field=$DATE_FIELD_ID -f date_value=$DATE --silent diff --git a/.github/workflows/issue-pull-request-upvote.yaml b/.github/workflows/issue-pull-request-upvote.yaml deleted file mode 100644 index 2363d66..0000000 --- a/.github/workflows/issue-pull-request-upvote.yaml +++ /dev/null @@ -1,98 +0,0 @@ -name: Upvote issue -on: - issue_comment: - types: - - created -jobs: - upvote: - runs-on: ubuntu-latest - env: - PROJECT_ID: PN_kwDOAPpDts0fAA - GITHUB_TOKEN: ${{secrets.GH_TOKEN_ORG_ADMIN}} - ISSUE_ID: ${{ github.event.issue.node_id || github.event.pull_request.node_id}} - steps: - - name: Count Interaction - run: | - gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' - query($issue_id: ID!){ - node(id: $issue_id) { - ...on Issue { - reactions(first: 1){ - totalCount - } - comments(first: 100) { - nodes{ - reactions(first: 1){ - totalCount - } - } - } - } - ...on PullRequest { - comments(first: 100) { - nodes{ - reactions(first: 1){ - totalCount - } - } - } - } - } - }' -f issue_id=$ISSUE_ID > raw.json - echo 'INTERACTIONS_VALUE='$(jq '.data.node | [(.reactions.totalCount), (.comments.nodes | length), ([.comments.nodes[].reactions.totalCount] | add)] | add' raw.json) >> $GITHUB_ENV - - name: Get the item id - env: - ORGANIZATION: asyncapi - PROJECT_NUMBER: 9 - run: | - gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' - query($org: String!, $number: Int!) { - organization(login: $org){ - projectNext(number: $number) { - id - items(first:100) { - nodes { - id - fieldValues(last: 2){ - nodes { - value - projectField { - id - name - } - } - } - content { - ... on Issue { - id - } - } - } - } - } - } - }' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > item_ids.json - echo 'ITEM_ID='$(jq '.data.organization.projectNext.items.nodes[] | select(.content.id=="'$ISSUE_ID'") | .id' item_ids.json) >> $GITHUB_ENV - echo 'INTERACTIONS_ID='$(jq '.data.organization.projectNext.items.nodes[] | select(.content.id=="'$ISSUE_ID'") | .fieldValues.nodes[] | select(.projectField.name=="NumberOfInteractions") | .projectField.id' item_ids.json) >> $GITHUB_ENV - - - name: Increment the interaction count. - run: | - INTERACTIONS_VALUE=$((INTERACTIONS_VALUE+1)) - gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' - mutation ( - $project: ID! - $item: ID! - $interaction_field: ID! - $interaction_value: String! - ) { - set_interaction: updateProjectNextItemField(input: { - projectId: $project - itemId: $item - fieldId: $interaction_field - value: $interaction_value - }) { - projectNextItem { - id - } - } - }' -f project=$PROJECT_ID -f item=$ITEM_ID -f interaction_field=$INTERACTIONS_ID -f interaction_value=$INTERACTIONS_VALUE --silent diff --git a/.github/workflows/issues-prs-notifications.yml b/.github/workflows/issues-prs-notifications.yml deleted file mode 100644 index e9840d6..0000000 --- a/.github/workflows/issues-prs-notifications.yml +++ /dev/null @@ -1,72 +0,0 @@ -#This action is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -#This action notifies community on slack whenever there is a new issue, PR or discussion started in given repository -name: Notify slack - -on: - - issues: - types: [opened, reopened] - - pull_request_target: - types: [opened, reopened, ready_for_review] - - discussion: - types: [created] - -jobs: - - issue: - if: github.event_name == 'issues' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' - name: On every new issue - runs-on: ubuntu-latest - steps: - - name: Convert markdown to slack markdown for issue - uses: LoveToKnow/slackify-markdown-action@v1.0.0 - id: issuemarkdown - with: - text: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" - - name: Send info about issue - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} - SLACK_TITLE: πŸ› New Issue πŸ› - SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} - MSG_MINIMAL: true - - pull_request: - if: github.event_name == 'pull_request_target' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' - name: On every new pull request - runs-on: ubuntu-latest - steps: - - name: Convert markdown to slack markdown for pull request - uses: LoveToKnow/slackify-markdown-action@v1.0.0 - id: prmarkdown - with: - text: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" - - name: Send info about pull request - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} - SLACK_TITLE: πŸ’ͺ New Pull Request πŸ’ͺ - SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}} - MSG_MINIMAL: true - - discussion: - if: github.event_name == 'discussion' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' - name: On every new pull request - runs-on: ubuntu-latest - steps: - - name: Convert markdown to slack markdown for pull request - uses: LoveToKnow/slackify-markdown-action@v1.0.0 - id: discussionmarkdown - with: - text: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" - - name: Send info about pull request - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} - SLACK_TITLE: πŸ’¬ New Discussion πŸ’¬ - SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} - MSG_MINIMAL: true diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml deleted file mode 100644 index fbee657..0000000 --- a/.github/workflows/lint-pr-title.yml +++ /dev/null @@ -1,22 +0,0 @@ -#This action is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -name: Lint PR title - -on: - - pull_request_target: - types: [opened, reopened, synchronize, edited, ready_for_review] - -jobs: - - lint: - runs-on: ubuntu-latest - steps: - - uses: amannn/action-semantic-pull-request@v3.2.5 - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - with: - subjectPattern: ^(?![A-Z]).+$ - subjectPatternError: | - The subject "{subject}" found in the pull request title "{title}" should start with a lowercase character. diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 0fab4bd..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Lint - -on: - pull_request: - types: [opened, reopened, synchronize, ready_for_review] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Run linter - run: npx mdv spec/*.md - diff --git a/.github/workflows/new-spec-release.yml b/.github/workflows/new-spec-release.yml deleted file mode 100644 index 8eef227..0000000 --- a/.github/workflows/new-spec-release.yml +++ /dev/null @@ -1,168 +0,0 @@ -name: Push new spec to the website because of new spec release - -on: - release: - types: - - published - -jobs: - Make-PR: - name: Make PR on website repository with latest spec release - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - steps: - - name: Checkout Current repository - uses: actions/checkout@v2 - with: - path: spec - ref: ${{ github.event.release.target_commitish }} - - name: Checkout Another repository - uses: actions/checkout@v2 - with: - repository: asyncapi/website - path: website - token: ${{ env.GITHUB_TOKEN }} - - name: Config git - run: | - git config --global user.name asyncapi-bot - git config --global user.email info@asyncapi.io - - name: Create branch - working-directory: ./website - run: | - git checkout -b spec-release-${{github.event.release.tag_name}} - - name: Check for previous spec file and remove it - uses: actions/github-script@v3 - with: - github-token: ${{ env.GITHUB_TOKEN }} - script: | - const fs = require("fs"); - - const specFiles = fs.readdirSync("./website/pages/docs/specifications"); - - const nextRelease = `${{github.event.release.tag_name}}`; - const prefixRelease = nextRelease.split("-")[0]; - - for (const filename of specFiles) { - if (filename.startsWith(prefixRelease)) { - fs.unlinkSync(`./website/pages/docs/specifications/${filename}`); - } - } - - name: Copy Spec file from Current Repo to Another - working-directory: ./website - run: | - cp ../spec/spec/asyncapi.md ./pages/docs/specifications/${{github.event.release.tag_name}}.md - - name: Remove Table of Contents from Spec - uses: actions/github-script@v4 - with: - github-token: ${{ env.GITHUB_TOKEN }} - script: | - const script = require('./spec/.github/scripts/remove-toc'); - script(`${{github.event.release.tag_name}}`); - - name: Change the redirect file to point to latest spec - uses: actions/github-script@v3 - if: ${{github.event.release.prerelease == false}} - with: - github-token: ${{ env.GITHUB_TOKEN }} - script: | - const fs = require("fs"); - - const startingLine = "# LATEST-SPEC-REDIRECTION:START\n"; - const endingLine = "# LATEST-SPEC-REDIRECTION:END"; - - const releaseVersion = `${{github.event.release.tag_name}}`; - const redirectLine = `/docs/specifications/latest /docs/specifications/${releaseVersion} 302!\n`; - - const redirectFile = fs.readFileSync("./website/public/_redirects", "utf-8"); - - const startingIndex = redirectFile.indexOf(startingLine); - const endingIndex = redirectFile.indexOf(endingLine); - - if (startingIndex === -1 || endingIndex === -1) { - console.log("NOT FOUND"); - return; - } - - const firstHalf = redirectFile.slice(0, startingIndex + startingLine.length); - const secondHalf = redirectFile.slice(endingIndex); - - const newRedirect = `${firstHalf}${redirectLine}${secondHalf}`; - - fs.writeFileSync("./website/public/_redirects", newRedirect); - - name: Remove previous pre-release redirects in case of a new release - uses: actions/github-script@v3 - with: - github-token: ${{ env.GITHUB_TOKEN }} - script: | - const fs = require("fs"); - - const startingLine = "# SPEC-REDIRECTION:START\n"; - const endingLine = "# SPEC-REDIRECTION:END\n"; - - const releaseVersion = `${{github.event.release.tag_name}}`; - - if(!releaseVersion.startsWith('v')) return; - - const releaseVersionWithoutV = releaseVersion.slice(1).split("-")[0]; - - const redirectFile = fs.readFileSync("./website/public/_redirects", "utf-8"); - - const startingIndex = redirectFile.indexOf(startingLine); - const endingIndex = redirectFile.indexOf(endingLine); - - if (startingIndex === -1 || endingIndex === -1) { - console.log("NOT FOUND"); - return; - } - - const firstHalf = redirectFile.slice(0, startingIndex + startingLine.length); - const middle = redirectFile.slice(startingIndex + startingLine.length, endingIndex); - const secondHalf = redirectFile.slice(endingIndex); - - const middleWithoutPreviousPreReleaseRedirects = middle.split("\n").filter(value => !value.includes(releaseVersionWithoutV)).join("\n"); - - const newRedirect = `${firstHalf}${middleWithoutPreviousPreReleaseRedirects}${secondHalf}`; - - fs.writeFileSync("./website/public/_redirects", newRedirect); - - name: Change the redirect file to point to specs - uses: actions/github-script@v3 - with: - github-token: ${{ env.GITHUB_TOKEN }} - script: | - const fs = require("fs"); - - const startingLine = "# SPEC-REDIRECTION:START\n"; - - const releaseVersion = `${{github.event.release.tag_name}}`; - - if(!releaseVersion.startsWith('v')) return; - - const releaseVersionWithoutV = releaseVersion.slice(1); - - const redirectLine = `/docs/specifications/${releaseVersionWithoutV} /docs/specifications/${releaseVersion} 302!\n`; - - const redirectFile = fs.readFileSync("./website/public/_redirects", "utf-8"); - - const startingIndex = redirectFile.indexOf(startingLine); - - if (startingIndex === -1) { - console.log("NOT FOUND"); - return; - } - - const firstHalf = redirectFile.slice(0, startingIndex + startingLine.length); - const secondHalf = redirectFile.slice(startingIndex + startingLine.length); - - const newRedirect = `${firstHalf}${redirectLine}${secondHalf}`; - - fs.writeFileSync("./website/public/_redirects", newRedirect); - - name: Commit and push - working-directory: ./website - run: | - git add . - git commit -m "docs(spec): ${{github.event.release.tag_name}} release" - git push https://${{ env.GITHUB_TOKEN }}@github.com/asyncapi/website - - name: Create PR - working-directory: ./website - run: | - gh pr create --title "docs(spec): ${{github.event.release.tag_name}} release" --body "New version of the specification is available and this PR introduces update to specification document on the website" --head "spec-release-${{github.event.release.tag_name}}" diff --git a/.github/workflows/pr-testing-with-generator.yml b/.github/workflows/pr-testing-with-generator.yml deleted file mode 100644 index 3654a93..0000000 --- a/.github/workflows/pr-testing-with-generator.yml +++ /dev/null @@ -1,25 +0,0 @@ -#We need something more sophisticated long term but for now adding simple tests that just runs the generation -name: Use the template with the generator - -on: - pull_request: - types: [opened, reopened, synchronize, ready_for_review] - -jobs: - test: - if: github.event.pull_request.draft == false - name: Generation with generator - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: 14 - - name: Install dependencies - run: NODE_ENV=production npm install - - name: Install generator - run: npm i @asyncapi/generator - - name: Run generation - run: node_modules/@asyncapi/generator/cli.js https://raw.githubusercontent.com/asyncapi/generator/v1.1.5/test/docs/dummy.yml ./ -o test/output --force-write diff --git a/.github/workflows/pr-testing-with-test-project.yml b/.github/workflows/pr-testing-with-test-project.yml deleted file mode 100644 index c7c5c64..0000000 --- a/.github/workflows/pr-testing-with-test-project.yml +++ /dev/null @@ -1,21 +0,0 @@ -#This workflow runs the tests in the test projects to make sure the generator works as a library where it is a Node dependency along with the template. -name: Test using test project - -on: - pull_request: - types: [opened, reopened, synchronize, ready_for_review] - -jobs: - test: - if: github.event.pull_request.draft == false - name: Test generator as dependency with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [ '12', '14', '15' ] - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Run test - run: NODE_IMAGE_TAG=${{ matrix.node }} docker-compose up --abort-on-container-exit --remove-orphans - working-directory: ./test/test-project diff --git a/.github/workflows/publish-gh-pages.yml b/.github/workflows/publish-gh-pages.yml deleted file mode 100644 index 6a55f46..0000000 --- a/.github/workflows/publish-gh-pages.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Publish Github Pages - -on: - push: - branches: - - master - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Build tck runner reports - run: make - working-directory: ./runner - - name: Create .nojekyll file - run: touch runner/reports/html/.nojekyll - - name: Install SSH Client - uses: webfactory/ssh-agent@v0.4.1 - with: - ssh-private-key: ${{ secrets.DEPLOY_KEY }} - - name: Deploy to Github Pages - uses: JamesIves/github-pages-deploy-action@releases/v3 - with: - SSH: true - BRANCH: gh-pages # The branch the action should deploy to. - FOLDER: runner/reports/html/ # The folder the action should deploy. diff --git a/.github/workflows/release-announcements.yml b/.github/workflows/release-announcements.yml deleted file mode 100644 index 653ca28..0000000 --- a/.github/workflows/release-announcements.yml +++ /dev/null @@ -1,76 +0,0 @@ -#This action is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo -name: 'Announce releases in different channels' - -on: - release: - types: - - published - -jobs: - - slack: - name: Slack - notify on every release - runs-on: ubuntu-latest - steps: - - name: Convert markdown to slack markdown for issue - uses: LoveToKnow/slackify-markdown-action@v1.0.0 - id: markdown - with: - text: "[${{github.event.release.tag_name}}](${{github.event.release.html_url}}) \n ${{ github.event.release.body }}" - - name: Send info about release to Slack - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASES }} - SLACK_TITLE: Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild 😱πŸ’ͺπŸΎπŸŽ‚ - SLACK_MESSAGE: ${{steps.markdown.outputs.text}} - MSG_MINIMAL: true - - twitter: - name: Twitter - notify on minor and major releases - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - name: Get version of last and previous release - uses: actions/github-script@v3 - id: versions - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const query = `query($owner:String!, $name:String!) { - repository(owner:$owner, name:$name){ - releases(first: 2, orderBy: {field: CREATED_AT, direction: DESC}) { - nodes { - name - } - } - } - }`; - const variables = { - owner: context.repo.owner, - name: context.repo.repo - }; - const { repository: { releases: { nodes } } } = await github.graphql(query, variables); - core.setOutput('lastver', nodes[0].name); - // In case of first release in the package, there is no such thing as previous error, so we set info about previous version only once we have it - // We should tweet about the release no matter of the type as it is initial release - if (nodes.length != 1) core.setOutput('previousver', nodes[1].name); - - name: Identify release type - id: releasetype - # if previousver is not provided then this steps just logs information about missing version, no errors - run: echo "::set-output name=type::$(npx -q -p semver-diff-cli semver-diff ${{steps.versions.outputs.previousver}} ${{steps.versions.outputs.lastver}})" - - name: Get name of the person that is behind the newly released version - id: author - run: echo "::set-output name=name::$(git log -1 --pretty=format:'%an')" - - name: Publish information about the release to Twitter # tweet only if detected version change is not a patch - # tweet goes out even if the type is not major or minor but "You need provide version number to compare." - # it is ok, it just means we did not identify previous version as we are tweeting out information about the release for the first time - if: steps.releasetype.outputs.type != 'null' && steps.releasetype.outputs.type != 'patch' # null means that versions are the same - uses: m1ner79/Github-Twittction@v1.0.1 - with: - twitter_status: "Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild 😱πŸ’ͺπŸΎπŸŽ‚\n\nThank you for the contribution ${{ steps.author.outputs.name }} ${{github.event.release.html_url}}" - 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 }} \ No newline at end of file diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml deleted file mode 100644 index 0265106..0000000 --- a/.github/workflows/release-docker.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Release Docker Image -on: - release: - types: - - published - -jobs: - - release: - name: Docker build and push - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - ref: master - - name: Get version without v character - id: version - run: | - VERSION=${{github.event.release.tag_name}} - VERSION_WITHOUT_V=${VERSION:1} - echo "::set-output name=value::$(echo $VERSION_WITHOUT_V)" - - name: Release to Docker - run: | - echo ${{secrets.DOCKER_PASSWORD}} | docker login -u ${{secrets.DOCKER_USERNAME}} --password-stdin - sleep 1m #docker image installs generator from npm, this sleep protects this step from any delays on npm side - npm run docker:build - docker tag asyncapi/generator:latest asyncapi/generator:${{ steps.version.outputs.value }} - docker push asyncapi/generator:${{ steps.version.outputs.value }} - docker push asyncapi/generator:latest - - - diff --git a/.github/workflows/release-wc-and-playground.yml b/.github/workflows/release-wc-and-playground.yml deleted file mode 100644 index 1ce5be1..0000000 --- a/.github/workflows/release-wc-and-playground.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Release Web-component and Playground - -on: - release: - types: - - published - -jobs: - - webcomponent: - name: Release Web-component - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - 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 - # if @semantic-release/github is used to publish, the minimum version is 7.2.0 for proper working - ref: ${{ github.event.release.target_commitish }} - - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: 14 - - name: Install latest version of library in the web-component - run: VERSION=${{github.event.release.tag_name}} npm run install:reactcomp - working-directory: ./web-component - - name: Install dependencies - run: npm install - - name: Bump version in package.json - # There is no need to substract "v" from the tag as version script handles it - # When adding "bump:version" script in package.json, make sure no tags are added by default (--no-git-tag-version) as they are already added by release workflow - # When adding "bump:version" script in package.json, make sure --allow-same-version is set in case someone forgot and updated package.json manually and we want to avoide this action to fail and raise confusion - run: VERSION=${{github.event.release.tag_name}} npm run bump:webcomp:version - - name: Release web-component to NPM (@latest tag) - if: github.event.release.target_commitish != 'next' - uses: JS-DevTools/npm-publish@v1 - with: - token: ${{ secrets.NPM_TOKEN }} - package: ./web-component/package.json - access: public - - name: Release web-component to NPM (@next tag) - if: github.event.release.target_commitish == 'next' - uses: JS-DevTools/npm-publish@v1 - with: - token: ${{ secrets.NPM_TOKEN }} - package: ./web-component/package.json - access: public - tag: next - - playground: - name: Release Playground - if: github.event.release.target_commitish == 'next' - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - 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 - # if @semantic-release/github is used to publish, the minimum version is 7.2.0 for proper working - ref: ${{ github.event.release.target_commitish }} - - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: 14 - - name: Use latest version of react component in the playground - run: VERSION=${{github.event.release.tag_name}} npm run install:reactcomp - working-directory: ./playground - - name: Install dependencies - run: npm install - - name: Build - run: npm run build - working-directory: ./playground - - name: Deploy GH page - uses: JamesIves/github-pages-deploy-action@3.4.2 - with: - ACCESS_TOKEN: ${{ secrets.GH_TOKEN }} - BRANCH: gh-pages - FOLDER: playground/build - GIT_CONFIG_NAME: asyncapi-bot - GIT_CONFIG_EMAIL: info@asyncapi.io \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index d731487..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Release the spec - -on: - push: - branches: - - master - - '**-release' - -jobs: - release: - name: 'Create GitHub release' - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v1 - - name: Add plugin for conventional commits - run: npm install conventional-changelog-conventionalcommits - - name: Release to GitHub - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - GIT_AUTHOR_NAME: asyncapi-bot - GIT_AUTHOR_EMAIL: info@asyncapi.io - GIT_COMMITTER_NAME: asyncapi-bot - GIT_COMMITTER_EMAIL: info@asyncapi.io - run: npx semantic-release@17.4.3 diff --git a/.github/workflows/scope-welcome.yml b/.github/workflows/scope-welcome.yml deleted file mode 100644 index 979db75..0000000 --- a/.github/workflows/scope-welcome.yml +++ /dev/null @@ -1,60 +0,0 @@ -on: - issues: - types: [opened, labeled] -name: Show instructions for scopes - -jobs: - publish: - runs-on: ubuntu-latest - - steps: - - name: Comment with instructions - uses: actions/github-script@v3 - with: - github-token: ${{ secrets.GH_TOKEN }} - script: | - const commentBody = 'Hey! You\'ve labeled this issue as a Scope. Remember you can use the following command to inform about its progress:' + - '\n' + - '```\n' + - '/progress [message]\n' + - '```\n' + - 'or\n' + - '```\n' + - '/progress \n\n' + - 'A mutiline message.\n' + - 'It supports **Markdown**.\n' + - '```\n\n' + - '##### Example:\n' + - '```\n' + - '/progress 40 We\'re still figuring out how to implement this. We have an idea but it is not yet confirmed it will work.\n' + - '```\n\n' + - '```\n' + - '/progress 50\n\n' + - 'A few notes:\n\n' + - '* We got this figured out :tada:\n' + - '* We\'re going to use [this library](#link-to-website) to avoid losing time implementing this algorithm.\n' + - '* We decided to go for the quickest solution and will improve it if we got time at the end of the cycle.\n' + - '```\n' + - '\n' + - '---\n' + - '\n' + - ':weight_lifting_woman: See the progress on the [Shape Up Dashboard](https://shapeup.asyncapi.io).\n' - - const comments = await github.issues.listComments({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo - }) - - for (const comment of comments.data) { - if (comment.body === commentBody) return - } - - if (context.payload.issue && Array.isArray(context.payload.issue.labels) && context.payload.issue.labels.find(l => l.name === 'Scope')) { - await github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: commentBody - }) - } diff --git a/.github/workflows/sentiment-analysis.yml b/.github/workflows/sentiment-analysis.yml deleted file mode 100644 index 431d193..0000000 --- a/.github/workflows/sentiment-analysis.yml +++ /dev/null @@ -1,44 +0,0 @@ -#This action is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -name: 'Sentiment Analysis' - -on: - issue_comment: - types: - - created - - edited - issues: - types: - - opened - - edited - pull_request: - types: - - opened - - edited - pull_request_review: - types: - - submitted - - edited - pull_request_review_comment: - types: - - created - - edited -jobs: - test: - name: Checking sentiments - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Check sentiment - uses: derberg/code-of-conduct-sentiment-analysis-github-action@v1 - id: sentiments - with: - gcp_key: ${{ secrets.GCP_KEY_SENTIMENT }} - - uses: someimportantcompany/github-actions-slack-message@v1 - # this step runs only if sentiment is a negative number - if: steps.sentiments.outputs.sentiment < -0.6 - with: - webhook-url: ${{ secrets.SLACK_SENTIMENTS }} - text: Here ${{steps.sentiments.outputs.source}} you can find a potential negative text that requires your attention as the sentiment analysis score is ${{steps.sentiments.outputs.sentiment}} - color: orange \ No newline at end of file diff --git a/.github/workflows/stale-issues-prs.yml b/.github/workflows/stale-issues-prs.yml deleted file mode 100644 index 57c0f18..0000000 --- a/.github/workflows/stale-issues-prs.yml +++ /dev/null @@ -1,42 +0,0 @@ -#This action is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -name: Manage stale issues and PRs - -on: - schedule: - - cron: "0 0 * * *" - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v4.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: | - This issue has been automatically marked as stale because it has not had recent activity :sleeping: - - It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. - - There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under [open governance model](https://github.com/asyncapi/community/blob/master/CHARTER.md). - - Let us figure out together how to push this issue forward. Connect with us through [one of many communication channels](https://github.com/asyncapi/community/issues/1) we established here. - - Thank you for your patience :heart: - stale-pr-message: | - This pull request has been automatically marked as stale because it has not had recent activity :sleeping: - - It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation. - - There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under [open governance model](https://github.com/asyncapi/community/blob/master/CHARTER.md). - - Let us figure out together how to push this pull request forward. Connect with us through [one of many communication channels](https://github.com/asyncapi/community/issues/1) we established here. - - Thank you for your patience :heart: - days-before-stale: 120 - days-before-close: 120 - stale-issue-label: stale - stale-pr-label: stale - exempt-issue-labels: keep-open - exempt-pr-labels: keep-open \ No newline at end of file diff --git a/.github/workflows/templates-list-validation.yml b/.github/workflows/templates-list-validation.yml deleted file mode 100644 index ad99814..0000000 --- a/.github/workflows/templates-list-validation.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Checking if list of templates is up to date - -on: - schedule: - - cron: "0 0 * * *" - -jobs: - templates: - name: 'Check list of templates' - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - uses: ./.github/templates-list-validator - with: - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index f573c50..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: "units-test" -on: - pull_request: - push: - branches: - - main - - 'release/*' - -jobs: - # test action works running from the graph - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: ./ - id: workflows2md - - uses: EndBug/add-and-commit@v7 - with: - cwd: ${{env.GITHUB_WORKSPACE}} - add: ${{ steps.workflows2md.outputs.path }} diff --git a/.github/workflows/twitter-a-main-workflow.yml b/.github/workflows/twitter-a-main-workflow.yml deleted file mode 100644 index 80fdd3c..0000000 --- a/.github/workflows/twitter-a-main-workflow.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow enables us to tweet together from the official AsyncAPI account :heart: -# Learn more from TWEET_TOGETHER instruction - -on: - push: - branches: - - master - pull_request: - types: [opened, reopened, synchronize, edited, ready_for_review] - -name: Twitter, together on AsyncAPI account! - -jobs: - test_tweet: - name: Test and Preview Tweet - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' - steps: - - uses: gr2m/twitter-together@v1.x - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - tweet: - name: Tweet - runs-on: ubuntu-latest - if: github.event_name == 'push' - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Tweet - uses: gr2m/twitter-together@v1.x - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }} - TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} - TWITTER_API_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }} - TWITTER_API_SECRET_KEY: ${{ secrets.TWITTER_CONSUMER_SECRET }} \ No newline at end of file diff --git a/.github/workflows/twitter-recurring-ideas.yml b/.github/workflows/twitter-recurring-ideas.yml deleted file mode 100644 index 6170c7d..0000000 --- a/.github/workflows/twitter-recurring-ideas.yml +++ /dev/null @@ -1,30 +0,0 @@ -on: - schedule: - # Schedule when tweet should go out - # At 09:00 on the first day of the month, every month. - # https://crontab.guru/#0_9_1_*_* - - cron: "0 9 1 * *" - -name: Create tweet about ideas # provide custom name for recurring workflow that will help identify what is it about -jobs: - create-ideas-tweet: # provide clear identifier - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup node to execute script - uses: actions/setup-node@v2 - with: - node-version: '14' - - name: Create another copy of the tweet - run: TWEET_FILENAME=discuss-ideas.tweet node ./.github/scripts/createRecurringTweetFile.js # provide a file name of the recurring tweet that you created - - name: Create Pull Request with new tweet - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.GH_TOKEN }} - commit-message: 'chore(tweet): recurring tweet about discussion tools ideas in our discussions forum' # put some sort description - committer: asyncapi-bot - author: asyncapi-bot - title: 'chore(tweet): recurring tweet about discussion tools ideas in our discussions forum' # put some sort description - body: 'This is a tweet that we want to share regularly to make sure all AsyncAPI followers know about discussions forum' # put some longer description - branch: 'tweet/${{github.job}}' \ No newline at end of file diff --git a/.github/workflows/twitter-recurring-slack.yml b/.github/workflows/twitter-recurring-slack.yml deleted file mode 100644 index 9a3c45d..0000000 --- a/.github/workflows/twitter-recurring-slack.yml +++ /dev/null @@ -1,28 +0,0 @@ -on: - schedule: - # Tweet at 10 every Saturday - - cron: "0 10 * * SAT" - -name: Create tweet about slack workspace -jobs: - create-slack-tweet: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup node to execute script - uses: actions/setup-node@v2 - with: - node-version: '14' - - name: Create another copy of the tweet - run: TWEET_FILENAME=slack-link.tweet node ./.github/scripts/createRecurringTweetFile.js - - name: Create Pull Request with new tweet - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.GH_TOKEN }} - commit-message: 'chore(tweet): recurring tweet about slack link' - committer: asyncapi-bot - author: asyncapi-bot - title: 'chore(tweet): recurring tweet about slack link' - body: 'This is a tweet that we want to share regularly to make sure all AsyncAPI followers know about our slack workspace' - branch: 'tweet/${{github.job}}' \ No newline at end of file diff --git a/.github/workflows/update-docs-on-docs-commits.yml b/.github/workflows/update-docs-on-docs-commits.yml deleted file mode 100644 index bb12c7b..0000000 --- a/.github/workflows/update-docs-on-docs-commits.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: 'Update generated parts of documentation on docs: commits' - -on: - push: - branches: - - master - -jobs: - docs-gen: - name: 'Generate docs and create PR' - 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: Regenerate docs - run: npm run generate:assets - - name: Create Pull Request with updated docs - # PR should be created within this GH action only if it is a docs: commit - # Otherwise it will conflict with release workflow - if: startsWith(github.event.commits[0].message, 'docs:') - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.GH_TOKEN }} - commit-message: 'chore: update generated docs' - committer: asyncapi-bot - author: asyncapi-bot - title: 'chore: update generated docs' - body: 'Update of docs that are generated and were forgotten on PR level.' - branch: gen-docs-update diff --git a/.github/workflows/update-spec.yaml b/.github/workflows/update-spec.yaml deleted file mode 100644 index 0dfa85e..0000000 --- a/.github/workflows/update-spec.yaml +++ /dev/null @@ -1,61 +0,0 @@ -name: Update latest specification document in the website - -on: - push: - branches: - - 'master' - paths: - - 'spec/asyncapi.md' - -jobs: - Make-PR: - name: Make PR on website repository with updated latest spec - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - steps: - - name: Checkout Current repository - uses: actions/checkout@v2 - with: - path: spec - - name: Checkout Another repository - uses: actions/checkout@v2 - with: - repository: asyncapi/website - path: website - token: ${{ env.GITHUB_TOKEN }} - - name: Config git - run: | - git config --global user.name asyncapi-bot - git config --global user.email info@asyncapi.io - - name: Get latest release - id: latest_version - uses: abatilo/release-info-action@v1.3.0 - with: - owner: asyncapi - repo: spec - - name: Create branch - working-directory: ./website - run: | - git checkout -b update-spec-${{ steps.latest_version.outputs.latest_tag }} - - name: Copy Spec file from Current Repo to Another - working-directory: ./website - run: | - cp ../spec/spec/asyncapi.md ./pages/docs/specifications/${{ steps.latest_version.outputs.latest_tag }}.md - - name: Remove Table of Contents from Spec - uses: actions/github-script@v4 - with: - github-token: ${{ env.GITHUB_TOKEN }} - script: | - const script = require('./spec/.github/scripts/remove-toc'); - script(`${{ steps.latest_version.outputs.latest_tag }}`); - - name: Commit and push - working-directory: ./website - run: | - git add . - git commit -m "docs(spec): update latest specification" - git push https://${{ env.GITHUB_TOKEN }}@github.com/asyncapi/website - - name: Create PR - working-directory: ./website - run: | - gh pr create --title "docs(spec): update latest specification" --body "Updated specification is available and this PR introduces update to specification document on the website" --head "update-spec-${{ steps.latest_version.outputs.latest_tag }}" diff --git a/.github/workflows/update-website.yml b/.github/workflows/update-website.yml deleted file mode 100644 index b0402c0..0000000 --- a/.github/workflows/update-website.yml +++ /dev/null @@ -1,49 +0,0 @@ -#This action update the list of TSC members in the website repository. List of all TSC members is later rendered in the asyncapi.com website. -name: Update list of TSC members in the website repo - -on: - push: - branches: - - 'master' - paths: - - 'TSC_MEMBERS.json' - -jobs: - update-website: - name: Make PR on website repository with updated tsc members list - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - steps: - - name: Checkout Current repository - uses: actions/checkout@v2 - with: - path: community - - name: Checkout Another repository - uses: actions/checkout@v2 - with: - repository: asyncapi/website - path: website - token: ${{ env.GITHUB_TOKEN }} - - name: Config git - run: | - git config --global user.name asyncapi-bot - git config --global user.email info@asyncapi.io - - name: Create branch - working-directory: ./website - run: | - git checkout -b update-tscmembers-${{ github.head_ref }} - - name: Copy tsc members file from Current Repo to Another - working-directory: ./website - run: | - cp ../community/TSC_MEMBERS.json ./config/TSC_MEMBERS.json - - name: Commit and push - working-directory: ./website - run: | - git add . - git commit -m "docs(community): update latest tsc members list" - git push https://${{ env.GITHUB_TOKEN }}@github.com/asyncapi/website - - name: Create PR - working-directory: ./website - run: | - gh pr create --title "docs(community): update latest tsc members list" --body "Updated TSC members list is available and this PR introduces changes with latest information about TSC members" --head "update-tscmembers-${{ github.head_ref }}" \ No newline at end of file diff --git a/.github/workflows/validate-tsc-members.yml b/.github/workflows/validate-tsc-members.yml deleted file mode 100644 index cca4742..0000000 --- a/.github/workflows/validate-tsc-members.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Validating the list of technical steering committee members - -on: - pull_request: - types: [opened, reopened, synchronize, ready_for_review] - paths: - - 'TSC_MEMBERS.json' -jobs: - # make sure that changes in the TSC_MEMBERS file is not breaking the schema - # until we have TSC_MEMBERS.json updates automated we need to make sure we are not breaking things - validate_schema: - if: github.event.pull_request.draft == false - name: Validate JSON Schema for TSC_MEMBERS list - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - run: npm install ajv@6.12.6 - - name: Validate list with schema - uses: actions/github-script@v4 - with: - script: | - const Ajv = require("ajv"); - const fs = require('fs').promises; - - const schema = await fs.readFile('.github/workflows/tsc_members_validator/schema.json', 'utf8'); - const members = await fs.readFile('TSC_MEMBERS.json', 'utf8'); - - const ajv = new Ajv(); - const validator = ajv.compile(JSON.parse(schema)); - - const valid = validator(JSON.parse(members)); - - if (!valid) { - core.error(`Validation of members file failed with the following errors:`); - core.error(validator.errors); - } else { - core.info(`TSC members file is valid`); - } - - # open governance model doesn't allow more than 1/4 TSC members affiliated with a single company - calculate_companies: - if: github.event.pull_request.draft == false - name: Calculate TSC members affiliation - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Calculate - uses: actions/github-script@v4 - with: - script: | - const members = require('./TSC_MEMBERS.json'); - const allMembers = members.length; - - const allowedMemberPerCompany = (allMembers/4).toFixed(0) - const numberOfMemByCompany = members.reduce((acc, m) => { - const company = m.company && m.company.toLowerCase(); - - if (company) acc.has(company) ? acc.set(company,acc.get(company)+1) : acc.set(company,1); - return acc; - }, new Map()) - - numberOfMemByCompany.forEach((numberOfRepresentatives, companyName) => { - if (numberOfRepresentatives > allowedMemberPerCompany) core.error(`There are to many members affiliated with ${companyName} and it violates open governance model. ${numberOfRepresentatives} is more that 1/4 of ${allMembers}`) - }) - diff --git a/.github/workflows/welcome-first-time-contrib.yml b/.github/workflows/welcome-first-time-contrib.yml deleted file mode 100644 index bff64dd..0000000 --- a/.github/workflows/welcome-first-time-contrib.yml +++ /dev/null @@ -1,83 +0,0 @@ -#This action is centrally managed in https://github.com/asyncapi/.github/ -#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -name: Welcome first time contributors -# Purpose of this workflow is to greet first time contributers in PRs and Issues. -on: - pull_request_target: - types: - - opened - issues: - types: - - opened - -jobs: - welcome: - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v3 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const issueMessage = `Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) and the instructions about a [basic recommended setup](https://github.com/asyncapi/.github/blob/master/git-workflow.md) useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`; - const prMessage = `Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`; - if (!issueMessage && !prMessage) { - throw new Error('Action must have at least one of issue-message or pr-message set'); - } - const isIssue = !!context.payload.issue; - let isFirstContribution; - if (isIssue) { - const query = `query($owner:String!, $name:String!, $contributer:String!) { - repository(owner:$owner, name:$name){ - issues(first: 1, filterBy: {createdBy:$contributer}){ - totalCount - } - } - }`; - const variables = { - owner: context.repo.owner, - name: context.repo.repo, - contributer: context.payload.sender.login - }; - const { repository: { issues: { totalCount } } } = await github.graphql(query, variables); - isFirstContribution = totalCount === 1; - } else { - const query = `query($qstr: String!) { - search(query: $qstr, type: ISSUE, first: 1) { - issueCount - } - }`; - const variables = { - "qstr": `repo:${context.repo.owner}/${context.repo.repo} type:pr author:${context.payload.sender.login}`, - }; - const { search: { issueCount } } = await github.graphql(query, variables); - isFirstContribution = issueCount === 1; - } - - if (!isFirstContribution) { - console.log(`Not the users first contribution.`); - return; - } - const message = isIssue ? issueMessage : prMessage; - // Add a comment to the appropriate place - if (isIssue) { - const issueNumber = context.payload.issue.number; - console.log(`Adding message: ${message} to issue #${issueNumber}`); - await github.issues.createComment({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, - issue_number: issueNumber, - body: message - }); - } - else { - const pullNumber = context.payload.pull_request.number; - console.log(`Adding message: ${message} to pull request #${pullNumber}`); - await github.pulls.createReview({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, - pull_number: pullNumber, - body: message, - event: 'COMMENT' - }); - }