diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 99446b0..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Build and push Docker image -on: - push: - branches: [master] - -jobs: - build: - name: Build and push Docker image - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Login to container registry - uses: docker/login-action@v2 - with: - registry: abc.docker-registry.gewis.nl - username: ${{ secrets.SVC_GH_PARELPRACHT_USERNAME }} - password: ${{ secrets.SVC_GH_PARELPRACHT_PWD }} - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: . - push: true - tags: abc.docker-registry.gewis.nl/crm/parelpracht/server:latest - diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml deleted file mode 100644 index 280437f..0000000 --- a/.github/workflows/eslint.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: ESLint -on: push - -jobs: - build: - name: ESLint - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Install Node - uses: actions/setup-node@v3 - with: - node-version: 18.x - - name: Run - run: npm ci && npm run lint diff --git a/.github/workflows/lint-and-build.yaml b/.github/workflows/lint-and-build.yaml new file mode 100644 index 0000000..377e6cb --- /dev/null +++ b/.github/workflows/lint-and-build.yaml @@ -0,0 +1,20 @@ +name: Lint and build + +on: + push: + branches: + - main-todo + - develop + pull_request: + branches: + - main-todo + - develop + +jobs: + build-and-lint: + uses: GEWIS/actions/.github/workflows/lint-and-build-yarn.yml@v1 + with: + node-version: "20.x" + lint: true + format: false + build: true diff --git a/.github/workflows/semantic-release.yaml b/.github/workflows/semantic-release.yaml new file mode 100644 index 0000000..46dd978 --- /dev/null +++ b/.github/workflows/semantic-release.yaml @@ -0,0 +1,25 @@ +name: Semantic release + +on: + push: + branches: + - main-todo + +jobs: + versioning: + uses: GEWIS/actions/.github/workflows/versioning.yml@v1 + + release: + uses: GEWIS/actions/.github/workflows/docker-release.yml@v1 + needs: versioning + if: ${{ needs.versioning.outputs.next-version != '' }} + with: + projects: "['.']" + version: ${{ needs.versioning.outputs.next-version }} + docker-registry: "abc.docker-registry.gewis.nl" + docker-paths: "['crm/parelpracht/server']" + github-registry: "false" + secrets: + REGISTRY_USERNAME: ${{ secrets.SVC_GH_PARELPRACHT_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.SVC_GH_PARELPRACHT_PWD }} + diff --git a/package.json b/package.json index 7e777a4..932ab58 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,8 @@ { "name": "parelpracht-server", - "version": "0.1.0", + "version": "1.0.0", "private": true, - "description": "", - "main": "index.js", + "license": "AGPL-3.0-or-later", "scripts": { "start": "node dist/index.js", "debug": "npm run clean && npm run tsoa && tsc && concurrently \"npm:build:dev\" \"npm:start:debug\" \"npm:tsoa:dev\"", @@ -18,9 +17,9 @@ "gen-client": "nswag openapi2tsclient /input:src/public/swagger.json /output:../parelpracht-client/src/clients/server.generated.ts /ServiceHost:.", "db:diagram": "typeorm-uml ormconfig.json", "db:validate": "node dist/dbvalidator/validate.js", - "lint": "eslint", - "lint:fix": "eslint --fix", - "test": "echo \"Error: no test specified\" && exit 0" + "lint": "eslint src", + "lint:fix": "eslint src --fix", + "prepublishOnly": "yarn install --frozen-lockfile && yarn build" }, "author": "The 39th board of Study Association GEWIS", "dependencies": { diff --git a/src/database.ts b/src/database.ts index 8c65000..c47ca73 100644 --- a/src/database.ts +++ b/src/database.ts @@ -35,10 +35,10 @@ const AppDataSource = new DataSource({ password: process.env.TYPEORM_PASSWORD, ...(process.env.TYPEORM_SSL_ENABLED === 'true' && process.env.TYPEORM_SSL_CACERTS ? { - ssl: { - ca: fs.readFileSync(process.env.TYPEORM_SSL_CACERTS), - }, - } + ssl: { + ca: fs.readFileSync(process.env.TYPEORM_SSL_CACERTS), + }, + } : {}), synchronize: process.env.TYPEORM_SYNCHRONIZE === 'true', logging: process.env.TYPEORM_LOGGING === 'true',