refactor!: transition constructor to options object and remove ESLint… #131
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Push to Registry | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'source/**' | |
| - 'package.json' | |
| - 'package-lock.json' | |
| - 'tsconfig.json' | |
| - 'Docker/**' | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| node-version: [20.x, 21.x, 22.x, 23.x, 24.x] | |
| fail-fast: false # Continue testing other versions even if one fails | |
| name: Test (Node ${{ matrix.node-version }}) | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' # Cache npm dependencies | |
| - name: Cache node modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-${{ matrix.node-version }}- | |
| ${{ runner.os }}-node- | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Run CRUD tests | |
| run: npm test crud | |
| - name: Run Transaction tests | |
| run: npm test transaction | |
| - name: Run Read Optimization tests | |
| run: npm test read | |
| publish_to_npm: | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write # Required for OIDC/Trusted Publishing | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Ensure npm 11.5.1 or later | |
| run: npm install -g npm@latest | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build package | |
| run: npm run build | |
| - name: Run GUI Build | |
| run: cd GUI && npm install && npm run build && cd .. | |
| - name: Move GUI build files | |
| run: cd ./GUI && mv AxioControl/ ../lib/server/public && cd .. | |
| - name: Publish to NPM Registry | |
| run: npm publish --access public | |
| publish_to_github: | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build package | |
| run: npm run build | |
| - name: Run GUI Build | |
| run: cd GUI && npm install && npm run build && cd .. | |
| - name: Move GUI build files | |
| run: cd ./GUI && mv AxioControl/ ../lib/server/public && cd .. | |
| - name: Set GitHub Auth Token | |
| run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GIT_AUTH_TOKEN }}" >> ~/.npmrc | |
| - name: Change package name in package.json | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y sed | |
| sed -i '2s/"axiodb"/"@${{ secrets.GIT_USER_NAME }}\/axiodb"/' package.json | |
| - name: Publish to GitHub Package Registry | |
| run: npm publish --registry=https://npm.pkg.github.com --scope=@${{ secrets.GIT_USER_NAME }} --access public | |
| publish_to_dockerhub: | |
| needs: [publish_to_npm] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build package | |
| run: npm run build | |
| - name: Run GUI Build | |
| run: cd GUI && npm install && npm run build && cd .. | |
| - name: Move GUI build files | |
| run: cd ./GUI && mv AxioControl/ ../lib/server/public && cd .. | |
| - name: Move the lib folder to Docker context | |
| run: mv lib/ Docker/ | |
| - name: Copy package.json files | |
| run: cp package*.json Docker/ | |
| - name: Copy Scripts folder to Docker context | |
| run: cp -r Scripts/ Docker/ | |
| # Login to Docker Hub | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build Docker image | |
| run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/axiodb:latest Docker/ | |
| - name: Push Docker image | |
| run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/axiodb:latest |