Skip to content

improve(cli): enhance handleLoadOptions to accept existing options #322

improve(cli): enhance handleLoadOptions to accept existing options

improve(cli): enhance handleLoadOptions to accept existing options #322

Workflow file for this run

name: build cli
on:
pull_request:
paths:
- 'cli/**'
release:
types:
- published
jobs:
build_packages:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '18.17'
- name: build
run: |
cd cli
yarn && yarn build
npm install -g pkg
pkg package.json
# - uses: actions/upload-artifact@v3
# with:
# name: cli
# path: cli/release
# - name: upload release asset
# if: github.event_name == 'release'
# run: |
# cd cli/release
# for var in $(ls); do
# $GITHUB_WORKSPACE/.github/workflows/upload_github_release_asset.sh \
# owner=${{ github.repository_owner }} \
# repo=mqttx \
# tag=$(echo ${{ github.ref }} | sed -r "s ^refs/heads/|^refs/tags/(.*) \1 g") \
# filename=$var \
# github_api_token=$(echo ${{ secrets.GITHUB_TOKEN }})
# done
publish_docker:
if: github.event_name == 'release'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: emqx/mqttx-cli
flavor: |
latest=${{ !github.event.release.prerelease }}
tags: |
type=ref,event=tag
- name: set up qemu
uses: docker/setup-qemu-action@v2
- name: set up docker buildx
uses: docker/setup-buildx-action@v2
- name: login to docker hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v3
with:
context: ./cli
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
publish_npm:
if: github.event_name == 'release' && !github.event.release.prerelease
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '18.17'
registry-url: 'https://registry.npmjs.org'
- name: build
run: |
cd cli
yarn && yarn build && yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}