diff --git a/.github/workflows/Build-And-Test-App.yml b/.github/workflows/Build-And-Test-App.yml index a2e6913..b401780 100644 --- a/.github/workflows/Build-And-Test-App.yml +++ b/.github/workflows/Build-And-Test-App.yml @@ -14,10 +14,10 @@ jobs: name: "Advance App (Windows)" runs-on: windows-latest steps: - - name: 📚 Checkout + - name: 📚 Get Repository uses: actions/checkout@v2.1.1 - - name: 🟢 Install Node + - name: 🟢 Install Node.js 18 uses: actions/setup-node@v4 with: always-auth: true @@ -25,18 +25,18 @@ jobs: scope: '@naveed235812' registry-url: https://registry.npmjs.org - - name: Install Dependencies + - name: Install Advance App Dependencies run: npm install - name: Build Advance App run: npm run build - - name: Execute Tests + - name: Execute Advance App Tests run: npm run test # # This step was added to show the output # - name: Execute Variant (Demo Purposes) - # run: node ./lib/index.js + # run: node ./output/RunAdvanceApp.js - name: Package Advance App run: npm pack diff --git a/.github/workflows/Release-App.yml b/.github/workflows/Release-App.yml index 5409049..1968a99 100644 --- a/.github/workflows/Release-App.yml +++ b/.github/workflows/Release-App.yml @@ -16,37 +16,28 @@ jobs: if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - - name: 'Download artifact' + - name: 'Download Advance App Artifacts' uses: actions/github-script@v6 with: script: | - let packs = ["app-advance-windows"]; - let artifactsObj = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id, - }); - for (var item of packs) { + const fs = require('fs'); + const packs = ["app-advance-windows"]; + const downloadPath = `${process.env.GITHUB_WORKSPACE}/`; + const obj = await github.rest.actions.listWorkflowRunArtifacts({repo: context.repo.repo, owner: context.repo.owner, run_id: context.payload.workflow_run.id}); + for (var item of packs) + { console.log(item); - let requiredArtifact = artifactsObj.data.artifacts.filter((artifact) => { - return artifact.name == item - })[0]; - let download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: requiredArtifact.id, - archive_format: 'zip', - }); - let fs = require('fs'); - let workspace = `${process.env.GITHUB_WORKSPACE}/`; - fs.writeFileSync(workspace+item+'.zip', Buffer.from(download.data)); + const requiredPack = obj.data.artifacts.filter((pack) => { return pack.name == item } )[0]; + const getArtifacts = await github.rest.actions.downloadArtifact({ archive_format: 'zip', repo: context.repo.repo, artifact_id: requiredPack.id, owner: context.repo.owner }); + const = downloadPath + item + '.zip'; + fs.writeFileSync(filePath, Buffer.from(getArtifacts.data)); }; - - name: 'Unzip Artifacts' + - name: 'Unzip Advance App Artifacts' run: | unzip app-advance-windows.zip - - name: 🟢 Node + - name: 🟢 Install Node.js 18 uses: actions/setup-node@v4 with: always-auth: true @@ -54,7 +45,7 @@ jobs: scope: '@naveed235812' registry-url: https://registry.npmjs.org - - name: Publish App + - name: Publish Advance App run: | import os from glob import glob diff --git a/.gitignore b/.gitignore index 0e0152f..86f0ff8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -# dependencies +output node_modules -package-lock.json - -# build output -lib +package-lock.json \ No newline at end of file diff --git a/.npmignore b/.npmignore index dd50a4f..23282f1 100644 --- a/.npmignore +++ b/.npmignore @@ -1,14 +1,9 @@ -# start off ignoring everything, and then add back only the files we want * -!bin/**/*.js -!lib/**/*.d.ts -!lib/**/*.js -!public/** -!package.json -!lib/**/*.json -!*.md src/ test/ -lib/test/ -.nyc_output/ -.rush/ \ No newline at end of file +!package.json +!*.md +!output/**/*.d.ts +!output/**/*.json +!output/**/*.js +output/test/ \ No newline at end of file diff --git a/package.json b/package.json index 035daea..bc93047 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "@naveed235812/app-advance-windows", - "version": "1.0.4", + "version": "1.0.5", "description": "Advance Application.", - "main": "index.js", + "main": "RunAdvanceApp.js", "bin": { - "app-advance": "./lib/index.js" + "app-advance": "./output/RunAdvanceApp.js" }, "author": "Naveed Ahmad", "license": "", @@ -13,25 +13,25 @@ "url": "https://github.com/naveedkhan8067/App_Advance" }, "scripts": { - "clean": "rimraf lib", - "copy:indexFile": "cpx ./src/index.js ./lib", - "build": "tsc 1>&2 && npm run copy:indexFile", - "test": "mocha -r ts-node/register src/test/**.test.ts --timeout 5000" + "build": "tsc 1>&2 && npm run copy:RunAdvanceApp", + "copy:RunAdvanceApp": "cpx ./src/RunAdvanceApp.js ./output", + "test": "mocha -r ts-node/register src/test/**.test.ts", + "clean": "rimraf output" }, "dependencies": { "commander": "^2.19.0", - "readdirp": "^3.0.0", - "@naveed235812/hello-world-windows": "1.0.6" + "@naveed235812/hello-world-windows": "1.0.6", + "readdirp": "^3.0.0" }, "devDependencies": { "@types/node": "18.11.5", + "ts-node": "^10.8.2", "@types/chai": "^4.1.7", - "@types/mocha": "^8.2.2", - "cpx2": "^3.0.0", - "rimraf": "^3.0.2", - "typescript": "~4.3.0", "chai": "^4.2.0", + "@types/mocha": "^8.2.2", "mocha": "^10.0.0", - "ts-node": "^10.8.2" + "typescript": "~4.3.0", + "cpx2": "^3.0.0", + "rimraf": "^3.0.2" } } diff --git a/src/index.js b/src/RunAdvanceApp.js similarity index 100% rename from src/index.js rename to src/RunAdvanceApp.js diff --git a/tsconfig.json b/tsconfig.json index ae98c59..5529d11 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,27 +4,14 @@ "declaration": true, "declarationMap": true, "esModuleInterop": false, - "experimentalDecorators": true, - "forceConsistentCasingInFileNames": true, - "incremental": true, - "inlineSources": true, "jsx": "react", "module": "commonjs", "moduleResolution": "node", - "noFallthroughCasesInSwitch": false, - "noImplicitOverride": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "noUnusedParameters": true, "skipLibCheck": true, "sourceMap": true, - "strict": true, - "strictNullChecks": true, - "stripInternal": false, "target": "ES2019", "noImplicitAny": false, - "outDir": "./lib", + "outDir": "./output", }, "include": [ "src/*.ts"