Skip to content

Commit

Permalink
Merge pull request #12 from Sleavely/main
Browse files Browse the repository at this point in the history
Code splitting the repo
  • Loading branch information
Furiiku authored Feb 6, 2024
2 parents c3a82e5 + 1141f3d commit 67f810a
Show file tree
Hide file tree
Showing 29 changed files with 10,155 additions and 1,129 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: ['@sleavely'],
rules: {
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'as' }],
}
}
47 changes: 47 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow causes release-please to maintain a Release PR
# which publishes to NPM once it has been merged.
# See https://github.com/google-github-actions/release-please-action

on:
push:
branches:
- main

name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: node

# The logic below handles the npm publication:
- uses: actions/checkout@v4
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}

- uses: actions/setup-node@v4
with:
node-version: 20
if: ${{ steps.release.outputs.release_created }}

- name: Install dependencies
run: npm ci
if: ${{ steps.release.outputs.release_created }}

- name: Build user scripts
run:
npm run build
if: ${{ steps.release.outputs.release_created }}

- name: Upload Release Artifact
run: gh release upload ${{ steps.release.outputs.tag_name }} ./dist/webhallen.user.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Tests & Linting

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run npm scripts on Node 20
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm run test
- run: npm run build
- name: Archive distributable
uses: actions/upload-artifact@v4
with:
name: dist-folder
path: |
dist
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
Loading

0 comments on commit 67f810a

Please sign in to comment.