diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml new file mode 100644 index 0000000..e926861 --- /dev/null +++ b/.github/actions/install/action.yml @@ -0,0 +1,14 @@ +name: "Clone and Install" +description: "Clones repository and sets up Node environment" +runs: + using: "composite" + steps: + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: npm install + shell: bash diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b752dd0..51d2862 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,15 +11,12 @@ jobs: name: Publish NPM Package steps: - - name: Cloning repo + - name: Check out repository uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '18.x' - registry-url: 'https://registry.npmjs.org' + - name: Clone and Install + uses: ./.github/actions/install - - run: npm i - run: npm run deploy env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..aa85da8 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,25 @@ +name: Build and Test + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build_and_test: + concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Clone and Install + uses: ./.github/actions/install + + - name: Build + run: npm run build diff --git a/package.json b/package.json index 46fcd42..c9c59e0 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,9 @@ "/oclif.manifest.json" ], "dependencies": { - "@oclif/core": "^1.16.0", - "@oclif/plugin-help": "^5", - "@oclif/plugin-plugins": "^2.0.1", + "@oclif/core": "^1.26.2", + "@oclif/plugin-help": "^6.2.27", + "@oclif/plugin-plugins": "^5.4.36", "flagsmith": "^9.0.5", "node-fetch": "^2.6.6" }, @@ -27,19 +27,19 @@ "@oclif/test": "^2.1.1", "@types/chai": "^4", "@types/mocha": "^9.0.0", - "@types/node": "^16.9.4", - "@types/node-fetch": "^2.6.2", + "@types/node": "^18.19.83", + "@types/node-fetch": "^2.6.6", "chai": "^4", "eslint": "^7.32.0", "eslint-config-oclif": "^4", "eslint-config-oclif-typescript": "^1.0.2", "globby": "^11", - "mocha": "^9", - "oclif": "^3", + "mocha": "^11.1.0", + "oclif": "^4.17.41", "shx": "^0.3.3", "ts-node": "^10.2.1", "tslib": "^2.3.1", - "typescript": "4.4.4" + "typescript": "5.8.2" }, "oclif": { "bin": "flagsmith", diff --git a/tsconfig.json b/tsconfig.json index 34727db..91250f7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,8 @@ "outDir": "dist", "rootDir": "src", "strict": true, - "target": "es2019" + "target": "es2019", + "skipLibCheck": true }, "include": [ "src/**/*"