Skip to content

Commit

Permalink
Merge pull request #12
Browse files Browse the repository at this point in the history
Cleanup added
  • Loading branch information
naveedkhan8067 authored Aug 6, 2024
2 parents 4de9e4e + 597fd9e commit 62eee98
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 72 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/Build-And-Test-App.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ jobs:
name: "Advance App (Windows)"
runs-on: windows-latest
steps:
- name: 📚 Checkout
- name: 📚 Get Repository
uses: actions/[email protected]

- name: 🟢 Install Node
- name: 🟢 Install Node.js 18
uses: actions/setup-node@v4
with:
always-auth: true
node-version: 18
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
Expand Down
37 changes: 14 additions & 23 deletions .github/workflows/Release-App.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,36 @@ 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
node-version: 18
scope: '@naveed235812'
registry-url: https://registry.npmjs.org

- name: Publish App
- name: Publish Advance App
run: |
import os
from glob import glob
Expand Down
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# dependencies
output
node_modules
package-lock.json

# build output
lib
package-lock.json
17 changes: 6 additions & 11 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -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/
!package.json
!*.md
!output/**/*.d.ts
!output/**/*.json
!output/**/*.js
output/test/
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": "",
Expand All @@ -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"
}
}
File renamed without changes.
15 changes: 1 addition & 14 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 62eee98

Please sign in to comment.