Skip to content

Commit ddb0a25

Browse files
committed
Migrate into Kyori org, update dependencies
1 parent 16d8035 commit ddb0a25

File tree

21 files changed

+6852
-5827
lines changed

21 files changed

+6852
-5827
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.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/

.github/workflows/check-release.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.
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 [email protected]
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/release.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

.github/workflows/size.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,49 @@ name: Test
22

33
on: push
44

5+
env:
6+
NODE_VERSION: "16.x"
7+
58
jobs:
69
test:
710
runs-on: ubuntu-latest
811
steps:
9-
- uses: actions/checkout@v2
10-
11-
- uses: actions/setup-node@v2
12+
- uses: actions/checkout@v3
13+
- name: Setup Node.js ${{ env.NODE_VERSION }}
14+
uses: actions/setup-node@v3
1215
with:
13-
node-version: "16.x"
14-
15-
- run: yarn install
16-
16+
node-version: ${{ env.NODE_VERSION }}
17+
cache: yarn
18+
- run: yarn install --immutable
1719
- run: yarn test
18-
1920
- run: yarn format-check
20-
2121
- run: yarn lint
22+
23+
functional-test:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v3
27+
- name: "Run regex match"
28+
uses: ./
29+
id: test-run
30+
with:
31+
text: "release/2.x"
32+
regex: 'release/([\d.x]+)'
33+
- name: "Validate output"
34+
env:
35+
MATCH: ${{ steps.test-run.outputs.match }}
36+
GROUP_1: ${{ steps.test-run.outputs.group1 }}
37+
run: |
38+
FAILED=0
39+
if [[ "$MATCH" != "release/2.x" ]]; then
40+
echo "::error title=Functional test failure::Wrong value for match, got '$MATCH' but expected 'release/2.x'"
41+
FAILED=1
42+
fi
43+
if [[ "$GROUP_1" != "2.x" ]]; then
44+
echo "::error title=Functional test failure::Wrong value for group 1, got '$GROUP_1' but expected '2.x'"
45+
FAILED=1
46+
fi
47+
48+
if [[ "$FAILED" -eq 1 ]]; then
49+
exit 1
50+
fi

.gitignore

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

0 commit comments

Comments
 (0)