Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making invidget ARM64 compatible #78

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 33 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: CI

on: [ push, pull_request_target ]
on: [push, pull_request_target]

env:
DOCKER_REGISTRY: switchbladebot/invidget
NODE_VERSION: 18.x

jobs:
lint:
Expand All @@ -9,40 +13,45 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
annotate: true
- name: Standard
run: npx standard
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install Dependencies
run: npm install
- name: Run Tests
run: npm test
env:
CI: true
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install
- name: Run Tests
run: npm test
env:
CI: true

build:
name: Docker
runs-on: ubuntu-latest
needs: [lint, test]
if: github.event_name == 'push'
strategy:
matrix:
node-version: [latest, ${{ github.ref }}]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build and publish to registry
uses: docker/build-push-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: switchbladebot/invidget
tag_with_ref: true
- name: Checkout
uses: actions/checkout@v3
- name: Build and publish to registry
uses: docker/build-push-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ${{ env.DOCKER_REGISTRY }}
tag_with_ref: ${{ matrix.tag }}
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM node:lts-alpine

# Build Stage
FROM node:lts-alpine as build
WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install
COPY . .

# Production Stage
FROM node:lts-alpine
WORKDIR /usr/src/app
COPY --from=build /usr/src/app /usr/src/app
EXPOSE 80

CMD [ "node", "src/index.js" ]
CMD [ "node", "src/index.js" ]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Switchblade
Copyright (c) 2023 Switchblade

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{
"name": "invidget",
"version": "1.0.0",
"version": "1.1.0",
"description": "SVG invite widgets that look just like the ones on the Discord client!",
"main": "src/index.js",
"engines": {
"node": ">=12"
},
"dependencies": {
"@sentry/node": "^6.13.2",
"@svgdotjs/svg.js": "^3.1.1",
"dd-trace": "^1.4.1",
"express": "^4.17.1",
"morgan": "^1.10.0",
"node-fetch": "^2.6.0",
"sharp": "^0.29.1",
"node-fetch": "^2.6.12",
"sharp": "^0.32.4",
"svgdom": "^0.1.8",
"text-to-svg": "^3.1.5",
"winston": "^3.10.0"
Expand All @@ -33,6 +36,11 @@
"type": "git",
"url": "git+https://github.com/SwitchbladeBot/invidget.git"
},
"cpu": [
"x64",
"ia32",
"arm"
],
"standard": {
"env": [
"jest"
Expand Down
Loading