1.0.1 #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Produce nutjs | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
checkversion: | |
name: Check if version has corrosponding tag | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
dobuild: ${{ steps.dobuild.outputs.dobuild }} | |
steps: | |
- name: Checkout firebot-nutjs | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Read package.json | |
id: package | |
uses: gregoranders/nodejs-project-info@v0.0.19 | |
- name: Retrieve package.json version | |
id: version | |
run: echo "version=${{ steps.package.outputs.version }}" >> $GITHUB_OUTPUT | |
- name: 'Check: package version has corrosponding git tag' | |
id: dobuild | |
shell: bash | |
run: echo dobuild=$(git show-ref --tags --verify --quiet -- "refs/tags/v${{ steps.version.outputs.version }}" && echo 0 || echo 1) >> $GITHUB_OUTPUT | |
libnut-core: | |
name: Build libnut-core for platforms | |
needs: | |
- checkversion | |
if: needs.checkversion.outputs.dobuild == 1 | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04, macos-latest, windows-2019 ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout libnut-core v2.5.1 | |
uses: actions/checkout@v4 | |
with: | |
repository: 'nut-tree/libnut-core' | |
ref: 'v2.5.1' | |
- name: Prepare Linux Environment | |
if: ${{ matrix.os == 'ubuntu-20.04' }} | |
run: sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev build-essential | |
- name: Install nodejs | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install Project Dependencies | |
run: npm install | |
- name: Build libnut-core | |
run: npm run build:release | |
- name: Store Compiled libnut-core | |
uses: actions/upload-artifact@v4 | |
with: | |
name: libnut-${{ runner.os }} | |
path: ./build/Release | |
firebot-nutjs: | |
name: Build firebot-nutjs | |
needs: | |
- checkversion | |
- libnut-core | |
if: needs.checkversion.outputs.dobuild == 1 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout firebot-nutjs | |
uses: actions/checkout@v4 | |
with: | |
ref: 'master' | |
- name: Install nodejs | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install Project Dependencies | |
run: npm install | |
- name: Transpile firebot-nutjs | |
run: npm run compile | |
- name: Download libnut-core Windows Build | |
uses: actions/download-artifact@v4 | |
with: | |
name: libnut-Windows | |
path: ./lib/libnut-core/windows | |
- name: Download libnut-core OSX Build | |
uses: actions/download-artifact@v4 | |
with: | |
name: libnut-macOS | |
path: ./lib/libnut-core/osx | |
- name: Download libnut-core Linux Build | |
uses: actions/download-artifact@v4 | |
with: | |
name: libnut-Linux | |
path: ./lib/libnut-core/linux | |
- name: Create Release branch | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: 'new release' | |
tag: 'v${{ needs.checkversion.outputs.version }}' | |
new_branch: '${{ needs.checkversion.outputs.version }}' | |