Skip to content

Commit 5d86143

Browse files
committed
feat: automation
Signed-off-by: Dan Selman <[email protected]>
1 parent deb2cb2 commit 5d86143

File tree

8 files changed

+341
-0
lines changed

8 files changed

+341
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @accordproject/maintainers-concerto

.github/pull_request_template.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!--- Provide a formatted commit message describing this PR in the Title above -->
2+
<!--- See our DEVELOPERS guide below: -->
3+
<!--- https://github.com/accordproject/techdocs/blob/master/DEVELOPERS.md#commit-message-format -->
4+
# Closes #<CORRESPONDING ISSUE NUMBER>
5+
<!--- Provide an overall summary of the pull request -->
6+
7+
### Changes
8+
<!--- More detailed and granular description of changes -->
9+
<!--- These should likely be gathered from commit message summaries -->
10+
- <ONE>
11+
- <TWO>
12+
13+
### Flags
14+
<!--- Provide context or concerns a reviewer should be aware of -->
15+
- <ONE>
16+
- <TWO>
17+
18+
### Screenshots or Video
19+
<!--- Provide an easily accessible demonstration of the changes, if applicable -->
20+
21+
### Related Issues
22+
- Issue #<NUMBER>
23+
- Pull Request #<NUMBER>
24+
25+
### Author Checklist
26+
- [ ] Ensure you provide a [DCO sign-off](https://github.com/probot/dco#how-it-works) for your commits using the `--signoff` option of git commit.
27+
- [ ] Vital features and changes captured in unit and/or integration tests
28+
- [ ] Commits messages follow [AP format](https://github.com/accordproject/techdocs/blob/master/DEVELOPERS.md#commit-message-format)
29+
- [ ] Extend the documentation, if necessary
30+
- [ ] Merging to `main` from `fork:branchname`
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
<!--- Provide a general summary of the issue in the Title above -->
11+
# Bug Report 🐛
12+
<!--- Provide an expanded summary of the issue -->
13+
14+
## Expected Behavior
15+
<!--- Tell us what should happen -->
16+
17+
## Current Behavior
18+
<!--- Tell us what happens instead of the expected behavior -->
19+
20+
## Possible Solution
21+
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
22+
23+
## Steps to Reproduce
24+
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
25+
<!--- reproduce this bug. Include code to reproduce, if relevant -->
26+
1.
27+
2.
28+
3.
29+
4.
30+
31+
## Context (Environment)
32+
<!--- How has this issue affected you? What are you trying to accomplish? -->
33+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
34+
### Desktop
35+
- OS: [e.g. macOS]
36+
- Browser: [e.g. Chrome, Safari]
37+
- Version: [e.g. 0.22.15]
38+
39+
## Detailed Description
40+
<!--- Provide a detailed description of the change or addition you are proposing -->
41+
42+
## Possible Implementation
43+
<!--- Not obligatory, but suggest an idea for implementing addition or change -->
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Custom Issue
3+
about: For miscellaneous, such as questions, discussions, etc.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
<!--- Provide a general summary of the issue in the Title above -->
11+
# Discussion 🗣
12+
<!--- Provide an expanded summary of the issue -->
13+
14+
## Context
15+
<!--- Providing context helps us come to the discussion informed -->
16+
17+
## Detailed Description
18+
<!--- Provide any further details -->
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
<!--- Provide a general summary of the feature in the Title above -->
11+
# Feature Request 🛍️
12+
<!--- Provide an expanded summary of the feature -->
13+
14+
## Use Case
15+
<!--- Tell us what feature we should support and what should happen -->
16+
17+
## Possible Solution
18+
<!--- Not obligatory, but suggest an implementation -->
19+
20+
## Context
21+
<!--- How has this issue affected you? What are you trying to accomplish? -->
22+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
23+
24+
## Detailed Description
25+
<!--- Provide a detailed description of the change or addition you are proposing -->

.github/workflows/build.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
name: Unit Tests
14+
15+
strategy:
16+
matrix:
17+
node-version:
18+
- 18.x
19+
os:
20+
- ubuntu-latest
21+
- windows-latest
22+
- macOS-latest
23+
24+
runs-on: ${{ matrix.os }}
25+
26+
steps:
27+
- name: git checkout
28+
uses: actions/checkout@v2
29+
30+
- name: Use Node.js ${{ matrix.node-version }}
31+
uses: actions/setup-node@v1
32+
with:
33+
node-version: ${{ matrix.node-version }}
34+
35+
- run: npm ci
36+
- run: npm run build --if-present
37+
- run: npm test
38+
39+
- name: Calculate code coverage
40+
run: npm run coverage
41+
42+
- name: Coveralls
43+
uses: coverallsapp/github-action@master
44+
with:
45+
github-token: ${{ secrets.GITHUB_TOKEN }}
46+
flag-name: ${{ matrix.os }}
47+
parallel: true
48+
49+
notify:
50+
needs:
51+
- build
52+
53+
name: Code Coverage
54+
if: ${{ success() }}
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- name: Coveralls Finished
59+
uses: coverallsapp/github-action@master
60+
with:
61+
github-token: ${{ secrets.GITHUB_TOKEN }}
62+
parallel-finished: true
63+
64+
publish:
65+
needs:
66+
- build
67+
- notify
68+
69+
name: Publish to npm
70+
if: ${{ success() && github.event_name == 'push' && github.repository_owner == 'accordproject' }}
71+
runs-on: ubuntu-latest
72+
73+
outputs:
74+
job-status: ${{ job.status }}
75+
76+
steps:
77+
- name: git checkout
78+
uses: actions/checkout@v2
79+
80+
- name: Use Node.js 18.x
81+
uses: actions/setup-node@v1
82+
with:
83+
node-version: 18.x
84+
85+
- run: npm ci
86+
- run: npm run build --if-present
87+
88+
- name: timestamp
89+
id: timestamp
90+
run: |
91+
node ./scripts/timestamp.js
92+
93+
- name: build and publish
94+
run: |
95+
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
96+
npm version --no-git-tag-version --yes --exact ${{ steps.timestamp.outputs.stamp }}
97+
npm publish --access public --tag=unstable 2>&1
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "main" ]
20+
schedule:
21+
- cron: '34 1 * * 1'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'javascript' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
52+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53+
# queries: security-extended,security-and-quality
54+
55+
56+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57+
# If this step fails, then you should remove it and run the build manually (see below)
58+
- name: Autobuild
59+
uses: github/codeql-action/autobuild@v2
60+
61+
# ℹ️ Command-line programs to run using the OS shell.
62+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63+
64+
# If the Autobuild fails above, remove it and uncomment the following three lines.
65+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66+
67+
# - run: |
68+
# echo "Run, Build Application using script"
69+
# ./location_of_script_within_repo/buildscript.sh
70+
71+
- name: Perform CodeQL Analysis
72+
uses: github/codeql-action/analyze@v2
73+
with:
74+
category: "/language:${{matrix.language}}"

.github/workflows/publish.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
publish:
10+
name: Publish to npm
11+
if: ${{ github.repository_owner == 'accordproject' }}
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: git checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 18.x
22+
23+
- run: npm ci
24+
- run: npm run build --if-present
25+
26+
- name: tag
27+
id: tag
28+
run: |
29+
node ./scripts/tag.js ${{ github.event.release.tag_name }}
30+
31+
- name: build and publish
32+
run: |
33+
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
34+
npm version --no-git-tag-version --yes --exact ${{ github.event.release.tag_name }}
35+
npm publish --access public ${{ steps.tag.outputs.tag }} 2>&1
36+
37+
- name: Create PR to increment version
38+
uses: peter-evans/create-pull-request@v3
39+
with:
40+
base: main
41+
commit-message: 'chore(actions): publish ${{ github.event.release.tag_name }} to npm'
42+
committer: GitHub <[email protected]>
43+
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
44+
signoff: true
45+
branch: ap-publish-${{ github.event.release.tag_name }}
46+
delete-branch: true
47+
title: 'chore(actions): publish ${{ github.event.release.tag_name }} to npm'
48+
body: |
49+
# Increment Versions
50+
Update the package.json version numbers after publishing to NPM.
51+
assignees: ${{ github.actor }}
52+
reviewers: ${{ github.actor }}
53+
draft: false

0 commit comments

Comments
 (0)