feat(npm): Build and publish NPM package (#43)
This commit is contained in:
committed by
GitHub
parent
cfe3da0aed
commit
abc6b132a8
29
.github/workflows/release.yml
vendored
29
.github/workflows/release.yml
vendored
@@ -14,11 +14,27 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
registry-url: https://npm.pkg.github.com
|
||||
scope: "@eveshipfit"
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set version
|
||||
run: |
|
||||
# Remove the "v" from the version.
|
||||
VERSION=$(echo ${{ github.ref_name }} | cut -b2-)
|
||||
echo "Version: ${VERSION}"
|
||||
sed -i 's/"version": "0.0.0-git"/"version": "'${VERSION}'"/' package.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y --no-install-recommends rclone protobuf-compiler
|
||||
pip install -r requirements.txt
|
||||
npm install
|
||||
|
||||
- name: Setup rclone
|
||||
run: |
|
||||
@@ -63,9 +79,20 @@ jobs:
|
||||
run: |
|
||||
python download_icons.py sde/fsd
|
||||
|
||||
- name: Build package
|
||||
run: |
|
||||
npm run build
|
||||
|
||||
- name: Publish package
|
||||
uses: JS-DevTools/npm-publish@v3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
registry: "https://npm.pkg.github.com"
|
||||
package: package.json
|
||||
|
||||
- name: Publish to R2 bucket
|
||||
run: |
|
||||
rclone copy dist eveshipfit:eveshipfit/${{ github.event.release.tag_name }}/ --progress
|
||||
rclone copy dist eveshipfit:eveshipfit/${{ github.event.release.tag_name }}/ --progress --exclude=*.{js,js.map,d.ts}
|
||||
env:
|
||||
RCLONE_CONFIG_EVESHIPFIT_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
||||
RCLONE_CONFIG_EVESHIPFIT_ENDPOINT: ${{ secrets.R2_ENDPOINT }}
|
||||
|
||||
32
.github/workflows/testing.yml
vendored
Normal file
32
.github/workflows/testing.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: Testing
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
testing:
|
||||
name: Testing
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
registry-url: https://npm.pkg.github.com
|
||||
scope: "@eveshipfit"
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Run linter
|
||||
run: npm run lint
|
||||
Reference in New Issue
Block a user