esptool-js-openDTU/.github/workflows/ci.yml
Brian Ignacio 102cf61030 add ci basic flow
update node version on publish

fix ci workflow

get version from package json

package version

fix env var

use github ref on publish

fix publish github ref

fix publish version
2022-11-28 17:09:31 +08:00

36 lines
1002 B
YAML

on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies and build 🔧
run: npm ci && npm run build
- name: Run lint
run: npm run lint
- name: Run tests
run: npm run test
- name: Package module
run: npm pack
- name: Determine version
id: version
run: |
ESPTOOLJS_VERSION=$(node -p "require('./package.json').version")
echo $ESPTOOLJS_VERSION
echo "version=$ESPTOOLJS_VERSION" >> $GITHUB_OUTPUT
- name: Upload npm package file
uses: actions/upload-artifact@v1
with:
name: esptool-js-${{ steps.version.outputs.version }}.tgz
path: esptool-js-${{ steps.version.outputs.version }}.tgz