diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..11c3727 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: "Build (Pull Request)" + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: + - main + - dev + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '23' + + - name: Install dependencies + run: npm ci + + - name: Run build + run: npm run build diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index c3b0fac..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Deploy - -on: - push: - branches: - - main - -jobs: - deploy: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup SSH - run: | - mkdir -p ~/.ssh - echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh-keyscan -H ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts - - - name: Deploy via SSH - run: | - ssh ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} << 'EOF' - cd /home/modl/modl-shared-web - git pull origin main - npm install - npm run build - EOF diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml new file mode 100644 index 0000000..48cb985 --- /dev/null +++ b/.github/workflows/release-package.yml @@ -0,0 +1,24 @@ +name: Node.js Package + +on: + release: + types: [created] + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '23' + registry-url: https://npm.pkg.github.com/ + scope: '@modl-gg' + - run: npm ci + - run: npm run build + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/package.json b/package.json index b538bcc..f043e96 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "modl-shared-web", + "name": "@modl-gg/shared-web", "version": "1.0.0", "description": "Shared schemas and types for the modl ecosystem.", "main": "dist/index.js", @@ -63,12 +63,20 @@ "build:esm": "tsc -p tsconfig.esm.json", "test": "echo \"Error: no test specified\" && exit 1" }, + "repository": { + "type": "git", + "url": "git+https://github.com/modl-gg/shared-web.git" + }, + "homepage": "https://github.com/modl-gg/shared-web", + "publishConfig": { + "registry": "https://npm.pkg.github.com" + }, "keywords": [ "modl", "shared" ], - "author": "", - "license": "ISC", + "author": "modl-gg", + "license": "AGPL-3.0-only", "dependencies": { "clsx": "^2.1.1", "tailwind-merge": "^2.3.0", @@ -125,4 +133,4 @@ "@types/react": "^18.3.3", "@types/express-session": "^1.18.2" } -} +} \ No newline at end of file diff --git a/src/schemas/TenantSchemas.ts b/src/schemas/TenantSchemas.ts index 2614a01..3495739 100644 --- a/src/schemas/TenantSchemas.ts +++ b/src/schemas/TenantSchemas.ts @@ -153,7 +153,8 @@ export const ReplySchema = new Schema({ created: { type: Date, default: Date.now }, staff: { type: Boolean, default: false }, action: { type: String }, - attachments: [{ type: mongoose.Schema.Types.Mixed }] + attachments: [{ type: mongoose.Schema.Types.Mixed }], + creatorIdentifier: { type: String } // Browser/device identifier for creator verification }); export const TicketSchema = new Schema({ diff --git a/src/types/index.ts b/src/types/index.ts index b12227c..bd1f0f6 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -165,6 +165,7 @@ export interface IReply { avatar?: string; action?: string; attachments?: any[]; + creatorIdentifier?: string; // Browser/device identifier for creator verification } export interface ITicket extends Document {