Skip to content

Commit ed719e9

Browse files
committed
initial commit
0 parents  commit ed719e9

32 files changed

Lines changed: 10875 additions & 0 deletions

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
[*.{ts,js,json,yml}]
8+
charset = utf-8
9+
indent_style = space
10+
indent_size = 2

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
lib/
3+
node_modules/

.eslintrc.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/recommended"
9+
],
10+
"parser": "@typescript-eslint/parser",
11+
"parserOptions": {
12+
"ecmaVersion": 2021,
13+
"sourceType": "module"
14+
},
15+
"plugins": [
16+
"@typescript-eslint"
17+
],
18+
"rules": {
19+
}
20+
};

.github/renovate.json5

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
$schema: "https://docs.renovatebot.com/renovate-schema.json",
3+
extends: [
4+
"local>KyoriPowered/.github:renovate-config"
5+
]
6+
}

.github/workflows/check-dist.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# `dist/index.js` is a special file in Actions.
2+
# When you reference an action with `uses:` in a workflow,
3+
# `index.js` is the code that will run.
4+
# For our project, we generate this file through a build process from other source files.
5+
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
6+
# This is stupid, but it's how GH works I guess.
7+
name: Check dist/
8+
9+
on:
10+
push:
11+
branches:
12+
- trunk
13+
paths-ignore:
14+
- '**.md'
15+
pull_request:
16+
paths-ignore:
17+
- '**.md'
18+
workflow_dispatch:
19+
20+
env:
21+
NODE_VERSION: "16.x"
22+
23+
jobs:
24+
check-dist:
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- uses: actions/checkout@v3
29+
30+
- name: Setup Node.js ${{ env.NODE_VERSION }}
31+
uses: actions/setup-node@v3
32+
with:
33+
node-version: ${{ env.NODE_VERSION }}
34+
cache: yarn
35+
36+
- name: Install dependencies
37+
run: yarn install --immutable
38+
39+
- name: Rebuild the dist/ directory
40+
run: |
41+
yarn run build
42+
- name: Compare the expected and actual dist/ directories
43+
run: |
44+
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
45+
echo "Detected uncommitted changes after build. See status below:"
46+
git diff
47+
exit 1
48+
fi
49+
id: diff
50+
51+
# If index.js was different than expected, upload the expected version as an artifact
52+
- uses: actions/upload-artifact@v3
53+
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
54+
with:
55+
name: dist
56+
path: dist/
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Fill in release tags
2+
3+
4+
# When a release tag is pushed (i.e v2.3.0), we can update shortened tags
5+
on:
6+
release:
7+
types:
8+
- released
9+
10+
jobs:
11+
check-dist:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: create tag parts
17+
id: match
18+
uses: ./
19+
with:
20+
text: ${{ github.event.release.tag_name }}
21+
regex: 'v((\d+)\.(\d+)\.(\d+))'
22+
- name: create and push tags
23+
env:
24+
RELEASE: ${{ steps.match.outputs.group1 }}
25+
MAJOR: ${{ steps.match.outputs.group2 }}
26+
MINOR: ${{ steps.match.outputs.group3 }}
27+
PATCH: ${{ steps.match.outputs.group4 }}
28+
run: |
29+
git config user.name github-actions
30+
git config user.email github-actions@github.com
31+
32+
git tag -f v$MAJOR.$MINOR -m "Release $RELEASE"
33+
git tag -f v$MAJOR -m "Release $RELEASE"
34+
git push -f --tags origin

.github/workflows/test.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Test
2+
3+
on: push
4+
5+
env:
6+
NODE_VERSION: "16.x"
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Setup Node.js ${{ env.NODE_VERSION }}
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: ${{ env.NODE_VERSION }}
17+
cache: yarn
18+
- run: yarn install --immutable
19+
- run: yarn test
20+
- run: yarn format-check
21+
- run: yarn lint
22+
23+
functional-test:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v3
27+
- name: "Test API calls"
28+
uses: ./
29+
id: test-run
30+
with:
31+
debug: true
32+
output_file: './test-out.txt'
33+
- name: "Validate output"
34+
env:
35+
LATEST: "${{ steps.test-run.outputs.latest_rc_or_nightly }}"
36+
RELEASE: "${{ steps.test-run.outputs.release }}"
37+
RC: "${{ steps.test-run.outputs.rc }}"
38+
NIGHTLY: "${{ steps.test-run.outputs.nightly }}"
39+
RELEASE_NIGHTLY: "${{ steps.test-run.outputs.release_nightly }}"
40+
run: |
41+
echo "::notice:: Latest: $LATEST"
42+
echo "::notice:: Release: $RELEASE"
43+
echo "::notice:: RC: $RC"
44+
echo "::notice:: Nightly: $NIGHTLY"
45+
echo "::notice:: Release Nightly: $RELEASE_NIGHTLY"
46+
47+
touch test-out.txt # just in case
48+
49+
echo "## Release info file" >> $GITHUB_STEP_SUMMARY
50+
echo '```' >> $GITHUB_STEP_SUMMARY
51+
cat test-out.txt >> $GITHUB_STEP_SUMMARY
52+
echo "" >> $GITHUB_STEP_SUMMARY
53+
echo '```' >> $GITHUB_STEP_SUMMARY

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
node_modules/
2+
__tests__/runner/*
3+
/.vscode/
4+
5+
# Yarn junk
6+
7+
.pnp.*
8+
.yarn/*
9+
!.yarn/patches
10+
!.yarn/plugins
11+
!.yarn/releases
12+
!.yarn/sdks
13+
!.yarn/versions
14+
/.yarn/releases/** binary
15+
/.yarn/plugins/** binary

.prettierrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "none",
8+
"bracketSpacing": true,
9+
"arrowParens": "avoid",
10+
"parser": "typescript"
11+
}

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 541 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)