Skip to content

updated

updated #99

Workflow file for this run

name: Create tagged release
on:
push:
tags:
- v4.1.*
jobs:
prebuild-lib:
name: "Build on Node v${{ matrix.node }} ${{ matrix.os.name }} ${{ matrix.arch }}"
runs-on: ${{ matrix.os.name }}-${{ matrix.os.version }}
strategy:
matrix:
os:
- name: Ubuntu
version: 20.04
- name: macOS
version: latest
- name: Windows
version: 2019
node: ["16"]
arch: [x64]
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.arch }}
- name: "Install npm@^8 to get a more up to date bundled node-gyp"
run: npm install --global [email protected]
- name: "Add Windows apps"
if: ${{ matrix.os.name == 'Windows' }}
run: |
choco install cmake -y
choco upgrade cmake
- name: "Setup-msbuild"
if: ${{ matrix.os.name == 'Windows' }}
uses: microsoft/[email protected]
- name: "Add Linux apps"
if: ${{ matrix.os.name == 'Ubuntu' }}
run: |
sudo apt-get update
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install cmake
- name: "Add macos apps"
if: ${{ matrix.os.name == 'macos' }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: "Install python"
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Dependency install
run: npm ci --unsafe-perm
- name: Create opencvlib
run: npm run create_opencvlib
- name: "Send Windows release to storage"
if: ${{ matrix.os.name == 'Windows' }}
uses: ncipollo/release-action@v1
with:
artifacts: "osOpencvWorlds/win32/*.tgz"
allowUpdates: true
- name: "Send macos release to storage"
if: ${{ matrix.os.name == 'macos' }}
uses: ncipollo/release-action@v1
with:
artifacts: "osOpencvWorlds/darwin/*.tgz"
allowUpdates: true
- name: "Send Ubuntu release to storage"
if: ${{ matrix.os.name == 'Ubuntu' }}
uses: ncipollo/release-action@v1
with:
artifacts: "osOpencvWorlds/linux/*.tgz"
allowUpdates: true
prebuild-node:
needs:
- prebuild-lib
name: "Build on Node v${{ matrix.node }} ${{ matrix.os.name }} ${{ matrix.arch }}"
runs-on: ${{ matrix.os.name }}-${{ matrix.os.version }}
strategy:
matrix:
os:
- name: Ubuntu
version: 20.04
- name: macOS
version: latest
- name: Windows
version: 2019
node: ["12", "13", "14", "15", "16", "18", "19.0.0", "20.0.0", "21.0.0"]
arch: [x64]
steps:
- name: Set up Git repository
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.arch }}
- name: "Install npm@^8 to get a more up to date bundled node-gyp"
run: npm install --global [email protected]
- name: "Install Linux dependencies"
if: ${{ matrix.os.name == 'Ubuntu' }}
run: |
sudo apt-get update
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install cmake
sudo apt-get install -y build-essential
- name: "Install python"
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: "Install Mac dependencies"
if: ${{ matrix.os.name == 'macos' }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Install
run: npm ci --unsafe-perm
- name: Prebuild
shell: bash
run: npm run create_opencvnode_prebuild
- uses: ncipollo/release-action@v1
with:
artifacts: "prebuilds/*.tar.gz"
allowUpdates: true
# prebuild-electron-node14:
# needs:
# - prebuild-lib
# name: "Build on Node v${{ matrix.node }} ${{ matrix.os.name }} ${{ matrix.arch }} electron ${{ matrix.electron }}"
# runs-on: ${{ matrix.os.name }}-${{ matrix.os.version }}
# strategy:
# matrix:
# os:
# - name: Ubuntu
# version: 20.04
# - name: macOS
# version: latest
# - name: Windows
# version: 2019
# node: ["14"]
# arch: [x64]
# runtime: [electron]
# electron:
# ["8.0.0", "9.0.0", "10.0.0", "11.0.0", "12.0.0", "13.0.0", "14.0.0"]
# steps:
# - name: Set up Git repository
# uses: actions/checkout@v3
# - name: Set up node
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node }}
# architecture: ${{ matrix.arch }}
# - name: "Install npm@^8 to get a more up to date bundled node-gyp"
# run: npm install --global [email protected]
# - name: "Install Linux dependencies"
# if: ${{ matrix.os.name == 'Ubuntu' }}
# run: |
# sudo apt-get update
# sudo apt-get install libudev-dev
# - name: "Install python"
# uses: actions/setup-python@v4
# with:
# python-version: "3.9"
# - name: "Install Mac dependencies"
# if: ${{ matrix.os.name == 'macos' }}
# uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: latest
# - name: Install
# run: npm ci --unsafe-perm
# - name: Prebuild
# shell: bash
# run: npm run create_opencvnode_prebuild -- -t ${{matrix.electron}} -r ${{matrix.runtime}}
# - uses: ncipollo/release-action@v1
# with:
# artifacts: "prebuilds/*.tar.gz"
# allowUpdates: true
# prebuild-electron-node16:
# needs:
# - prebuild-lib
# name: "Build on Node v${{ matrix.node }} ${{ matrix.os.name }} ${{ matrix.arch }} electron ${{ matrix.electron }}"
# runs-on: ${{ matrix.os.name }}-${{ matrix.os.version }}
# strategy:
# matrix:
# os:
# - name: Ubuntu
# version: 20.04
# - name: macOS
# version: latest
# - name: Windows
# version: 2019
# node: ["16"]
# arch: [x64]
# runtime: [ electron ]
# electron: [ "15.0.0", "16.0.0", "17.0.0", "18.0.0", "19.0.0", "22.0.0", "23.0.0", "24.0.0", "25.0.0" ]
# steps:
# - name: Set up Git repository
# uses: actions/checkout@v3
# - name: Set up node
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node }}
# architecture: ${{ matrix.arch }}
# - name: "Install npm@^8 to get a more up to date bundled node-gyp"
# run: npm install --global [email protected]
# - name: "Install Linux dependencies"
# if: ${{ matrix.os.name == 'Ubuntu' }}
# run: |
# sudo apt-get update
# sudo apt-get install libudev-dev
# - name: "Install python"
# uses: actions/setup-python@v4
# with:
# python-version: "3.9"
# - name: "Install Mac dependencies"
# if: ${{ matrix.os.name == 'macos' }}
# uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: latest
# - name: Install
# run: npm ci --unsafe-perm
# - name: Prebuild
# shell: bash
# run: npm run create_opencvnode_prebuild -- -t ${{matrix.electron}} -r ${{matrix.runtime}}
# - uses: ncipollo/release-action@v1
# with:
# artifacts: "prebuilds/*.tar.gz"
# allowUpdates: true
deploy:
needs:
- prebuild-node
# - prebuild-electron-node14
# - prebuild-electron-node16
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
- name: 'Install npm@^8'
run: npm install --global [email protected]
- name: Install
run: npm ci --unsafe-perm
- name: Publish tagged release to npm
run: |
npm i clean-package -g
npm whoami
npm run publish_package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}