Preparations for v2 (#42)

* Add build process and cleanup old distro files

* Updated build process to produce node_modules

* Fix caching.

* Rename action

* Add master to deployment action

* Add master to deployment action

* Trigger build on any branch push

* Add token for automatic commits during build process
This commit is contained in:
Corey Butler 2023-03-30 22:15:29 -05:00 committed by GitHub
parent 80d7827f03
commit c47fa43261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 21401 deletions

40
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,40 @@
name: Create Action
on:
push:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare Dependency Cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install Dependencies
run: npm install
- name: Build
run: |
rm -rf ./dist
npm run prepare
cp ./src/package.json ./dist/
cd ./dist
mkdir -p ./node_modules
npm i
- name: Commit Build Artifacts
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git add .
git commit -m "Build distribution files"
git push

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ logs
_*
node_modules
!./src/node_modules
dist

21400
dist/main.js vendored

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,7 @@
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "esbuild --bundle ./src/main.js --platform=node --outdir=dist"
"prepare": "esbuild --bundle ./src/main.js --platform=node --outdir=dist --external:octokit"
},
"repository": {
"type": "git",