Skip to content

Commit

Permalink
Merge pull request #721 from particle-iot/feature/cli-installer-v2
Browse files Browse the repository at this point in the history
feature/cli installer v2
  • Loading branch information
hugomontero authored May 14, 2024
2 parents 2aa0897 + ff4ee61 commit 2cca0f6
Show file tree
Hide file tree
Showing 50 changed files with 4,053 additions and 945 deletions.
196 changes: 0 additions & 196 deletions .circleci/config.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Run Tests on Branch
on:
push:
branches:
- '**'
- '!staging'
jobs:
call-tests:
uses: ./.github/workflows/reusable-tests.yml
secrets: inherit
23 changes: 23 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Deploy to production
on:
push:
tags:
- v*
jobs:
call-tests:
uses: ./.github/workflows/reusable-tests.yml
secrets: inherit
call-build:
uses: ./.github/workflows/reusable-build.yml
secrets: inherit
needs: call-tests
call-publish-v2:
uses: ./.github/workflows/reusable-publish-v2.yml
secrets: inherit
needs: call-build
with:
environment: production
call-publish-npm:
uses: ./.github/workflows/reusable-publish-npm.yml
secrets: inherit
needs: call-publish-v2
102 changes: 102 additions & 0 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Build Package

on: [workflow_call]
env:
E2E_DEVICE_ID: ${{ secrets.E2E_DEVICE_ID }}
E2E_DEVICE_NAME: ${{ secrets.E2E_DEVICE_NAME }}
E2E_DEVICE_PLATFORM_ID: ${{ secrets.E2E_DEVICE_PLATFORM_ID }}
E2E_DEVICE_PLATFORM_NAME: ${{ secrets.E2E_DEVICE_PLATFORM_NAME }}
E2E_FOREIGN_DEVICE_ID: ${{ secrets.E2E_FOREIGN_DEVICE_ID }}
E2E_FOREIGN_DEVICE_NAME: ${{ secrets.E2E_FOREIGN_DEVICE_NAME }}
E2E_FOREIGN_DEVICE_PLATFORM_ID: ${{ secrets.E2E_FOREIGN_DEVICE_PLATFORM_ID }}
E2E_FOREIGN_DEVICE_PLATFORM_NAME: ${{ secrets.E2E_FOREIGN_DEVICE_PLATFORM_NAME }}
E2E_FOREIGN_PASSWORD: ${{ secrets.E2E_FOREIGN_PASSWORD }}
E2E_FOREIGN_USERNAME: ${{ secrets.E2E_FOREIGN_USERNAME }}
E2E_PASSWORD: ${{ secrets.E2E_PASSWORD }}
E2E_PRODUCT_01_DEVICE_01_GROUP: ${{ secrets.E2E_PRODUCT_01_DEVICE_01_GROUP }}
E2E_PRODUCT_01_DEVICE_01_ID: ${{ secrets.E2E_PRODUCT_01_DEVICE_01_ID }}
E2E_PRODUCT_01_DEVICE_01_NAME: ${{ secrets.E2E_PRODUCT_01_DEVICE_01_NAME }}
E2E_PRODUCT_01_DEVICE_01_PLATFORM_ID: ${{ secrets.E2E_PRODUCT_01_DEVICE_01_PLATFORM_ID }}
E2E_PRODUCT_01_DEVICE_01_PLATFORM_NAME: ${{ secrets.E2E_PRODUCT_01_DEVICE_01_PLATFORM_NAME }}
E2E_PRODUCT_01_DEVICE_02_GROUP: ${{ secrets.E2E_PRODUCT_01_DEVICE_02_GROUP }}
E2E_PRODUCT_01_DEVICE_02_ID: ${{ secrets.E2E_PRODUCT_01_DEVICE_02_ID }}
E2E_PRODUCT_01_DEVICE_02_NAME: ${{ secrets.E2E_PRODUCT_01_DEVICE_02_NAME }}
E2E_PRODUCT_01_DEVICE_02_PLATFORM_ID: ${{ secrets.E2E_PRODUCT_01_DEVICE_02_PLATFORM_ID }}
E2E_PRODUCT_01_DEVICE_02_PLATFORM_NAME: ${{ secrets.E2E_PRODUCT_01_DEVICE_02_PLATFORM_NAME }}
E2E_PRODUCT_01_ID: ${{ secrets.E2E_PRODUCT_01_ID }}
E2E_PRODUCT_01_NAME: ${{ secrets.E2E_PRODUCT_01_NAME }}
E2E_USERNAME: ${{ secrets.E2E_USERNAME }}
PARTICLE_WINDOWS_SIGNING_CERT: ${{ secrets.PARTICLE_WINDOWS_SIGNING_CERT }}
PARTICLE_WINDOWS_SIGNING_PASS: ${{ secrets.PARTICLE_WINDOWS_SIGNING_PASS }}
jobs:
build:
runs-on: ubuntu-latest # Choose an appropriate runner
steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Configure NPM Token
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}

- name: Install dependencies
run: npm install

- name: Restore Cache
uses: actions/cache@v3
with:
path: ~/.pkg-cache
key: node16-pkg-${{ github.run_id }}
restore-keys: node16-pkg-

- name: Add pre-built Node for armv7
run: |
mkdir -p ~/.pkg-cache/v3.4
cp .prebuild/built-v16.16.0-linux-armv7 ~/.pkg-cache/v3.4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm,arm64

- name: Set up ldid
uses: MOZGIII/install-ldid-action@v1
with:
tag: v2.1.5-procursus7

- name: Build Package
run: npm run build

- name: 'Install makensis (apt)'
run: sudo apt update && sudo apt install -y nsis nsis-pluginapi

- name: Download and unzip osslsigncode binary
run: |
mkdir osslsigncode
curl -LJO https://github.com/mtrojnar/osslsigncode/releases/download/2.6/osslsigncode-2.6-ubuntu-20.04.zip
unzip osslsigncode-2.6-ubuntu-20.04.zip -d osslsigncode
chmod +x osslsigncode/bin/osslsigncode
- name: Sign Windows package
run: |
npm run sign:win -- particle-cli-win-x64 $(pwd)/osslsigncode/bin/osslsigncode
- name: Generate Windows installer
run: |
npm run generate:win-installer $(pwd)/osslsigncode/bin/osslsigncode
- name: Save Cache
uses: actions/cache@v3
with:
path: ~/.pkg-cache
key: node16-pkg-${{ github.run_id }}

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: package
path: build/

19 changes: 19 additions & 0 deletions .github/workflows/reusable-publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build Package

on: [workflow_call]

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Configure NPM Token
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
- name: Install dependencies
run: npm install
- name: Publish package
run: npm publish ${{github.ref_name}}
Loading

0 comments on commit 2cca0f6

Please sign in to comment.