Skip to content

Commit

Permalink
feat: Initial implementation of subscribers
Browse files Browse the repository at this point in the history
  • Loading branch information
robdmoore committed Nov 24, 2023
1 parent e261be0 commit b8c6a8a
Show file tree
Hide file tree
Showing 27 changed files with 11,139 additions and 2,285 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Proposed Changes

-
-
-
12 changes: 12 additions & 0 deletions .github/workflows/issue_closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Solve zendesk ticket when the issue is closed
on:
issues:
types: [closed]
jobs:
issue_closed:
uses: algorandfoundation/gh_zendesk_sync/.github/workflows/github_zendesk_issue_closed.yml@main
with:
ZENDESK_TENANT_NAME: ${{ vars.ZENDESK_TENANT_NAME }}
ISSUE_LABEL: makerx
secrets:
ZENDESK_AUTH_TOKEN: ${{ secrets.ZENDESK_AUTH_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/issue_commented.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Add comment to zendesk ticket on GitHub issue commented
on:
issue_comment:
types: [created]
jobs:
issue_closed:
uses: algorandfoundation/gh_zendesk_sync/.github/workflows/github_zendesk_issue_commented.yml@main
with:
ZENDESK_TENANT_NAME: ${{ vars.ZENDESK_TENANT_NAME }}
ISSUE_LABEL: makerx
secrets:
ZENDESK_AUTH_TOKEN: ${{ secrets.ZENDESK_AUTH_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/issue_labelled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Create Zendesk ticket when an issue is labelled with makerx
on:
issues:
types: [labeled]
jobs:
issue_created:
uses: algorandfoundation/gh_zendesk_sync/.github/workflows/github_zendesk_issue_labelled.yml@main
with:
ZENDESK_TENANT_NAME: ${{ vars.ZENDESK_TENANT_NAME }}
ISSUE_LABEL: makerx
secrets:
ZENDESK_AUTH_TOKEN: ${{ secrets.ZENDESK_AUTH_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Pull Request

on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
pull_request:
uses: makerxstudio/shared-config/.github/workflows/node-ci.yml@main
with:
node-version: 18.x
working-directory: ./
run-commit-lint: true
run-build: true
pre-test-script: |
pipx install algokit
algokit localnet start
npx --yes wait-on tcp:4001 -t 30000
audit-script: |
npm run audit
check_docs:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Check docs are up to date
shell: bash
run: |
npm ci --ignore-scripts
npm run generate:code-docs
# Add untracked files as empty so they come up in diff
git add -N .
# Print changed files and error out if there are changes after generating docs
git diff --exit-code --name-only
31 changes: 31 additions & 0 deletions .github/workflows/prod_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Prod Publish

on:
workflow_dispatch:

permissions:
contents: write

jobs:
prod_release:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Merge main -> release
uses: devmasx/merge-branch@854d3ac71ed1e9deb668e0074781b81fdd6e771f
with:
type: now
from_branch: main
target_branch: release
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Merge release -> main
uses: devmasx/merge-branch@854d3ac71ed1e9deb668e0074781b81fdd6e771f
with:
type: now
from_branch: release
target_branch: main
message: Merge release back to main to get version increment [no ci]
github_token: ${{ secrets.GITHUB_TOKEN }}
92 changes: 92 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Publish

on:
push:
branches:
- main
- release
workflow_dispatch:

concurrency: release

permissions:
contents: write

jobs:
ci:
name: Continuous Integration
uses: makerxstudio/shared-config/.github/workflows/node-ci.yml@main
with:
node-version: 18.x
run-commit-lint: true
pre-test-script: |
pipx install algokit
algokit localnet start
npx --yes wait-on tcp:4001 -t 30000
audit-script: |
npm run audit
check_docs:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Check docs are up to date
shell: bash
run: |
npm ci --ignore-scripts
npm run generate:code-docs
# Add untracked files as empty so they come up in diff
git add -N .
# Print changed files and error out if there are changes after generating docs
git diff --exit-code --name-only
build:
name: Build
uses: makerxstudio/shared-config/.github/workflows/node-build-zip.yml@main
needs:
- ci
- check_docs
with:
node-version: 18.x
build-path: dist
artifact-name: package

release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
fetch-depth: 0

# semantic-release needs node 18
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Download built package
uses: actions/download-artifact@v3
with:
name: package
path: artifacts

- name: Unzip package
shell: bash
run: |
mkdir -p dist
unzip -q "artifacts/package.zip" -d dist
- name: Install dependencies to get semantic release components and plugins
run: npm ci --ignore-scripts

- name: 'Semantic release'
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
11 changes: 11 additions & 0 deletions .github/workflows/zendesk_github_add_comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Add comment to GitHub issue on Zendesk ticket commented
on:
repository_dispatch:
types:
- zendesk_github_add_comment
permissions:
issues: write
jobs:
add-comment:
name: Add comment to issue
uses: algorandfoundation/gh_zendesk_sync/.github/workflows/zendesk_github_add_comment.yml@main
11 changes: 11 additions & 0 deletions .github/workflows/zendesk_github_close_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Close GitHub issue on Zendesk ticket solved
on:
repository_dispatch:
types:
- zendesk_github_close_issue
permissions:
issues: write
jobs:
close_issue:
name: Close GitHub issue
uses: algorandfoundation/gh_zendesk_sync/.github/workflows/zendesk_github_close_issue.yml@main
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"version": "0.2.0",
"configurations": [
{
"name": "Run indexer",
"name": "Run examples/data-history-museum",
"type": "node",
"request": "launch",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "dev"],
"runtimeArgs": ["run", "dhm"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**", "node_modules/**"],
Expand All @@ -18,11 +18,11 @@
},

{
"name": "Run indexer (loop)",
"name": "Run examples/data-history-museum (loop)",
"type": "node",
"request": "launch",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "watch"],
"runtimeArgs": ["run", "dhm-loop"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**", "node_modules/**"],
Expand Down
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Algorand Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
14 changes: 14 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
// Allow sentence case commit messages
'subject-case': [1, 'always', ['pascal-case', 'upper-case']],
'type-empty': [1, 'never'],
'subject-empty': [1, 'always'],
'body-leading-blank': [0, 'always'],
'body-max-line-length': [1, 'always', 200],
'header-max-length': [1, 'always', 150],
'footer-max-length': [1, 'always', 150],
'footer-max-line-length': [1, 'always', 150],
},
}
Loading

0 comments on commit b8c6a8a

Please sign in to comment.