Skip to content

Commit

Permalink
Migrate into Kyori org, update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
zml2008 committed Nov 27, 2022
1 parent 16d8035 commit ddb0a25
Show file tree
Hide file tree
Showing 21 changed files with 6,852 additions and 5,827 deletions.
14 changes: 0 additions & 14 deletions .github/dependabot.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: [
"local>KyoriPowered/.github:renovate-config"
]
}
56 changes: 56 additions & 0 deletions .github/workflows/check-dist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# `dist/index.js` is a special file in Actions.
# When you reference an action with `uses:` in a workflow,
# `index.js` is the code that will run.
# For our project, we generate this file through a build process from other source files.
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
# This is stupid, but it's how GH works I guess.
name: Check dist/

on:
push:
branches:
- trunk
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:

env:
NODE_VERSION: "16.x"

jobs:
check-dist:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: Install dependencies
run: yarn install --immutable

- name: Rebuild the dist/ directory
run: |
yarn run build
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
id: diff

# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/
38 changes: 0 additions & 38 deletions .github/workflows/check-release.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/fill-in-tags.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Fill in release tags


# When a release tag is pushed (i.e v2.3.0), we can update shortened tags
on:
release:
types:
- released

jobs:
check-dist:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: create tag parts
id: match
uses: ./
with:
text: ${{ github.event.release.tag_name }}
regex: 'v((\d+)\.(\d+)\.(\d+))'
- name: create and push tags
env:
RELEASE: ${{ steps.match.outputs.group1 }}
MAJOR: ${{ steps.match.outputs.group2 }}
MINOR: ${{ steps.match.outputs.group3 }}
PATCH: ${{ steps.match.outputs.group4 }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git tag -f v$MAJOR.$MINOR -m "Release $RELEASE"
git tag -f v$MAJOR -m "Release $RELEASE"
git push -f --tags origin
67 changes: 0 additions & 67 deletions .github/workflows/release.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/size.yml

This file was deleted.

47 changes: 38 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,49 @@ name: Test

on: push

env:
NODE_VERSION: "16.x"

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- name: Setup Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: "16.x"

- run: yarn install

node-version: ${{ env.NODE_VERSION }}
cache: yarn
- run: yarn install --immutable
- run: yarn test

- run: yarn format-check

- run: yarn lint

functional-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Run regex match"
uses: ./
id: test-run
with:
text: "release/2.x"
regex: 'release/([\d.x]+)'
- name: "Validate output"
env:
MATCH: ${{ steps.test-run.outputs.match }}
GROUP_1: ${{ steps.test-run.outputs.group1 }}
run: |
FAILED=0
if [[ "$MATCH" != "release/2.x" ]]; then
echo "::error title=Functional test failure::Wrong value for match, got '$MATCH' but expected 'release/2.x'"
FAILED=1
fi
if [[ "$GROUP_1" != "2.x" ]]; then
echo "::error title=Functional test failure::Wrong value for group 1, got '$GROUP_1' but expected '2.x'"
FAILED=1
fi
if [[ "$FAILED" -eq 1 ]]; then
exit 1
fi
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
node_modules/
lib/
__tests__/runner/*

# Yarn junk

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
/.yarn/releases/** binary
/.yarn/plugins/** binary
Loading

0 comments on commit ddb0a25

Please sign in to comment.