Skip to content

v0.10.0

v0.10.0 #41

Workflow file for this run

name: Release
on:
release:
types: [created]
jobs:
prepare:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: lts/*
- name: generate lock files
run: npm i
- uses: actions/setup-node@v3
with:
node-version: lts/*
cache: npm
- name: generate tests datas
run: npm run generate:data
- uses: actions/upload-artifact@v3
with:
name: prepare
path: |
./package-lock.json
./tests/datas
# This workflow contains a single job called "build"
build:
needs: [ prepare ]
# The type of runner that the job will run on
runs-on: ubuntu-latest
# do a matrix test with different node versions
strategy:
fail-fast: false
matrix:
node-version: [ lts/*, 16 ]
#can't test on 5.6.42 because database is too up-to-date ( 5.12.72 )
unifi-version: [ latest, 7.3.83, 7.2.95, 7.1.68, 7.0.25, 6.5.55, 6.4.54, version-6.2.26, version-6.0.45 ]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: prepare
path: .
# try to perform a nodejs setup
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: install+run docker-unifi-controller
run: |
# install our own demo database
mkdir unifi-storage
sudo tar -C unifi-storage -xf $GITHUB_WORKSPACE/.github/workflows/db-demo-dump.tar.bz2
# create docker-unifi-controller
docker create --name=unifi-controller -e PUID=1001 -e PGID=116 -p 8443:8443 -v $GITHUB_WORKSPACE/unifi-storage:/config linuxserver/unifi-controller:${{ matrix.unifi-version }}
docker start unifi-controller
# wait for unifi-controller to be ready
while ! curl -ks https://127.0.0.1:8443; do echo waiting for unifi-controller; sleep 2; done
echo unifi-controller answer
- name: npm install, build, and test
run: |
npm install
npm run build
echo start tests
npm run test:CI:coverage
env:
CI: true
deploy-npm:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: lts/*
registry-url: 'https://registry.npmjs.org'
- run: npm install
env:
CI: true
- run: npm publish --access public
name: publish on npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
deploy-GPR:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: lts/*
registry-url: 'https://npm.pkg.github.com'
scope: ${{ github.repository_owner }}
- run: npm install
env:
CI: true
- run: npx npe name @${{ github.event.repository.full_name }}
name: change scope name
- run: npm publish --access public --registry https://npm.pkg.github.com
name: publish on GPR
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}