Skip to content

Commit

Permalink
Merge pull request #32 from naveedkhan8067/enable-trigger
Browse files Browse the repository at this point in the history
Enable trigger
  • Loading branch information
naveedkhan8067 authored May 18, 2024
2 parents 0cd2d42 + f6bef91 commit b244a2c
Show file tree
Hide file tree
Showing 2 changed files with 182 additions and 167 deletions.
333 changes: 166 additions & 167 deletions .github/workflows/Build-And-Test-Component.yml
Original file line number Diff line number Diff line change
@@ -1,135 +1,134 @@
name: "Build-And-Test-Component"

## Run this action on every push to master branch
on:
workflow_dispatch: # To manually run the job
push:
branches:
- main
paths:
- components/hello-world/**
- .github/workflows/Build-And-Test-Component-CI.yml
- .github/workflows/Build-And-Test-Component.yml
pull_request:
branches:
- main
paths:
- components/hello-world/**
- .github/workflows/Build-And-Test-Component-CI.yml
- .github/workflows/Build-And-Test-Component.yml

jobs:
component-linux:
name: "Component Linux Variant"
runs-on: ubuntu-latest
steps:
- name: 📚 Checkout
uses: actions/[email protected]

- name: 🟢 Node
uses: actions/setup-node@v4
with:
always-auth: true
node-version: 18
scope: '@naveed235812'
registry-url: https://registry.npmjs.org

- name: Install C-Preprocessor
run: npm install -g c-preprocessor

- name: Prepare and Execute C-Preprocessor
run: |
python prepareVariantConfig.py
env:
VARIANT_TYPE: LINUX

# - name: Execute C-Preprocessor
# run: |
# npm install c-preprocessor -g
# echo example of c-preprocessor
# c-preprocessor ./src/Main.ts ./src/Main.ts
# working-directory: ./components/hello-world

- name: Install Dependencies
run: npm install
working-directory: ./components/hello-world

- name: Build Component
run: npm run build
working-directory: ./components/hello-world

- name: Execute Tests
run: npm run test
working-directory: ./components/hello-world

- name: Execute Linux Variant
run: node ./lib/index.js
working-directory: ./components/hello-world

- name: Package Component
run: npm pack
working-directory: ./components/hello-world

- name: Publish LINUX Component
uses: actions/upload-artifact@v3
with:
name: hello-world-linux
path: ./components/hello-world/naveed235812-hello-world-linux-*.tgz

component-mac:
name: "Component Mac Variant"
runs-on: macos-latest
steps:
- name: 📚 Checkout
uses: actions/[email protected]

- name: 🟢 Node
uses: actions/setup-node@v4
with:
always-auth: true
node-version: 18
scope: '@naveed235812'
registry-url: https://registry.npmjs.org

- name: Install C-Preprocessor
run: npm install -g c-preprocessor

- name: Prepare and Execute C-Preprocessor
run: |
python prepareVariantConfig.py
env:
VARIANT_TYPE: MAC

# - name: Execute C-Preprocessor
# run: |
# npm install c-preprocessor -g
# echo example of c-preprocessor
# c-preprocessor ./src/Main.ts ./src/Main.ts
# working-directory: ./components/hello-world

- name: Install Dependencies
run: npm install
working-directory: ./components/hello-world

- name: Build Component
run: npm run build
working-directory: ./components/hello-world

- name: Execute Tests
run: npm run test
working-directory: ./components/hello-world

- name: Execute Mac Varient
run: node ./lib/index.js
working-directory: ./components/hello-world

- name: Package Component
run: npm pack
working-directory: ./components/hello-world

- name: Publish MAC Component
uses: actions/upload-artifact@v3
with:
name: hello-world-mac
path: ./components/hello-world/naveed235812-hello-world-mac-*.tgz
# component-linux:
# name: "Component Linux Variant"
# runs-on: ubuntu-latest
# steps:
# - name: 📚 Checkout
# uses: actions/[email protected]

# - name: 🟢 Node
# uses: actions/setup-node@v4
# with:
# always-auth: true
# node-version: 18
# scope: '@naveed235812'
# registry-url: https://registry.npmjs.org

# - name: Install C-Preprocessor
# run: npm install -g c-preprocessor

# - name: Prepare and Execute C-Preprocessor
# run: |
# python prepareVariantConfig.py
# env:
# VARIANT_TYPE: LINUX

# # - name: Execute C-Preprocessor
# # run: |
# # npm install c-preprocessor -g
# # echo example of c-preprocessor
# # c-preprocessor ./src/Main.ts ./src/Main.ts
# # working-directory: ./components/hello-world

# - name: Install Dependencies
# run: npm install
# working-directory: ./components/hello-world

# - name: Build Component
# run: npm run build
# working-directory: ./components/hello-world

# - name: Execute Tests
# run: npm run test
# working-directory: ./components/hello-world

# - name: Execute Linux Variant
# run: node ./lib/index.js
# working-directory: ./components/hello-world

# - name: Package Component
# run: npm pack
# working-directory: ./components/hello-world

# - name: Publish LINUX Component
# uses: actions/upload-artifact@v3
# with:
# name: hello-world-linux
# path: ./components/hello-world/naveed235812-hello-world-linux-*.tgz

# component-mac:
# name: "Component Mac Variant"
# runs-on: macos-latest
# steps:
# - name: 📚 Checkout
# uses: actions/[email protected]

# - name: 🟢 Node
# uses: actions/setup-node@v4
# with:
# always-auth: true
# node-version: 18
# scope: '@naveed235812'
# registry-url: https://registry.npmjs.org

# - name: Install C-Preprocessor
# run: npm install -g c-preprocessor

# - name: Prepare and Execute C-Preprocessor
# run: |
# python prepareVariantConfig.py
# env:
# VARIANT_TYPE: MAC

# # - name: Execute C-Preprocessor
# # run: |
# # npm install c-preprocessor -g
# # echo example of c-preprocessor
# # c-preprocessor ./src/Main.ts ./src/Main.ts
# # working-directory: ./components/hello-world

# - name: Install Dependencies
# run: npm install
# working-directory: ./components/hello-world

# - name: Build Component
# run: npm run build
# working-directory: ./components/hello-world

# - name: Execute Tests
# run: npm run test
# working-directory: ./components/hello-world

# - name: Execute Mac Varient
# run: node ./lib/index.js
# working-directory: ./components/hello-world

# - name: Package Component
# run: npm pack
# working-directory: ./components/hello-world

# - name: Publish MAC Component
# uses: actions/upload-artifact@v3
# with:
# name: hello-world-mac
# path: ./components/hello-world/naveed235812-hello-world-mac-*.tgz

component-windows:
name: "Component Windows Variant"
Expand Down Expand Up @@ -188,54 +187,54 @@ jobs:
name: hello-world-windows
path: ./components/hello-world/naveed235812-hello-world-windows-*.tgz

check-compatibility-with-windows-product:
needs:
- component-windows
name: "Product Advance Variant (Windows)"
runs-on: windows-latest
steps:
- name: Checkout Advance_Variant
uses: actions/checkout@v4
with:
repository: naveedkhan8067/Advance_Variant
token: ${{ secrets.ACCESS_TOKEN_GITHUB }}
path: Advance_Variant

- name: 🟢 Download Windows Component
uses: actions/download-artifact@v3
with:
name: hello-world-windows
path: ./Advance_Variant

- name: Display Root
run: |
dir
- name: Display Root
run: |
cd Advance_Variant
dir
- name: 🟢 Node
uses: actions/setup-node@v4
with:
always-auth: true
node-version: 18
scope: '@naveed235812'
registry-url: https://registry.npmjs.org

- name: Add Component
run: npm install naveed235812-hello-world-windows-1.0.1.tgz
working-directory: ./Advance_Variant

- name: Install Dependencies
run: npm install
working-directory: ./Advance_Variant

- name: Build Component
run: npm run build
working-directory: ./Advance_Variant

- name: Execute Advance Variant
run: node ./lib/index.js
working-directory: ./Advance_Variant
# check-compatibility-with-windows-product:
# needs:
# - component-windows
# name: "Product Advance Variant (Windows)"
# runs-on: windows-latest
# steps:
# - name: Checkout Advance_Variant
# uses: actions/checkout@v4
# with:
# repository: naveedkhan8067/Advance_Variant
# token: ${{ secrets.ACCESS_TOKEN_GITHUB }}
# path: Advance_Variant

# - name: 🟢 Download Windows Component
# uses: actions/download-artifact@v3
# with:
# name: hello-world-windows
# path: ./Advance_Variant

# - name: Display Root
# run: |
# dir

# - name: Display Root
# run: |
# cd Advance_Variant
# dir

# - name: 🟢 Node
# uses: actions/setup-node@v4
# with:
# always-auth: true
# node-version: 18
# scope: '@naveed235812'
# registry-url: https://registry.npmjs.org

# - name: Add Component
# run: npm install naveed235812-hello-world-windows-1.0.1.tgz
# working-directory: ./Advance_Variant

# - name: Install Dependencies
# run: npm install
# working-directory: ./Advance_Variant

# - name: Build Component
# run: npm run build
# working-directory: ./Advance_Variant

# - name: Execute Advance Variant
# run: node ./lib/index.js
# working-directory: ./Advance_Variant
16 changes: 16 additions & 0 deletions .github/workflows/Release-Hello-World-Component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,26 @@ on:
- completed
branches:
- main
- enable-trigger

jobs:
on-success:
runs-on: ubuntu-latest
permissions:
actions: write
checks: write
contents: write
deployments: write
id-token: write
issues: write
discussions: write
packages: write
pages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write

if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: 'Download artifact'
Expand Down

0 comments on commit b244a2c

Please sign in to comment.