diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..653376e --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1 @@ +module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..6ffc774 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ + + +#### :heavy_check_mark: Checklist + +- [ ] I have added tests for new functionality +- [ ] I have ran yarn tsc and yarn build with no errors +- [ ] I have added screenshots of before and after (for UI changes) +- [ ] I have added or updated documentation (if applicable) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7a6d040 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: CI + +on: + pull_request: + branches: ["main"] + types: [opened, reopened] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18.x] + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: yarn install + - run: yarn tsc + - run: yarn build:all + - run: yarn test:all diff --git a/.github/workflows/gh-release.yml b/.github/workflows/gh-release.yml new file mode 100644 index 0000000..debcf2f --- /dev/null +++ b/.github/workflows/gh-release.yml @@ -0,0 +1,46 @@ +name: Release +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 18 + - run: yarn install + - run: yarn tsc + - run: yarn build:all + create-github-release: + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Create Release + run: gh release create ${{ github.ref }} --generate-notes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + publish: + needs: create-github-release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 18 + registry-url: https://npm.pkg.github.com/ + scope: "@sammbetts" + - run: yarn install + - run: git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" && git config --global user.name "$GITHUB_ACTOR" + - run: yarn version --minor + - run: git push --tags && git push + - run: yarn publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..326bd6b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish +on: + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 18 + - run: yarn install + - run: yarn tsc + - run: yarn build:all + publish: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 18 + registry-url: https://npm.pkg.github.com/ + scope: '@sammbetts' + - run: yarn install + - run: git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" && git config --global user.name "$GITHUB_ACTOR" + - run: yarn version --minor + - run: git push --tags && git push + - run: yarn publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..4703271 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,51 @@ +name: Pull Request + +on: + pull_request: + paths-ignore: + - README.md + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + cache: yarn + node-version-file: .tool-versions + - run: yarn install --immutable + - run: yarn lint:all + +prettier: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + - name: Configure / Setup with Yarn + uses: actions/setup-node@v3 + with: + cache: yarn + node-version-file: .tool-versions + - run: yarn install --immutable + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v37 + with: + files: | + **/*.md + **/*.yml + **/*.yaml + **/*.ts + **/*.js + **/*.html + - name: Prettify code + uses: creyD/prettier_action@v4.3 + with: + prettier_options: >- + --check ${{ steps.changed-files.outputs.all_changed_files }} + dry: true + only_changed: false \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c253fcc --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +node_modules +dist +dist-types +.env +.npmrc +.npmignore +.prettierignore