Skip to content

Add development releases for master branch (like autobahn-python) #115

Add development releases for master branch (like autobahn-python)

Add development releases for master branch (like autobahn-python) #115

Workflow file for this run

name: main
on:
push:
branches: [master]
tags:
- 'v*'
pull_request:
branches: [master]
workflow_dispatch:
permissions:
contents: read
pull-requests: read
env:
# Node 24 is current LTS (Krypton) - use for builds
NODE_VERSION: '24'
PYTHON_VERSION: '3.11'
jobs:
identifiers:
# GitHub needs to know where .cicd/workflows/identifiers.yml lives at parse time,
# and submodules aren't included in that context! thus the following does NOT work:
# uses: ./.cicd/workflows/identifiers.yml
# we MUST reference the remote repo directly:
uses: wamp-proto/wamp-cicd/.github/workflows/identifiers.yml@main
# IMPORTANT: we still need .cicd as a Git submodule in the using repo though!
# because e.g. identifiers.yml wants to access scripts/sanitize.sh !
lint:
name: ESLint
needs: identifiers
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Just
run: |
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/bin
echo "$HOME/bin" >> $GITHUB_PATH
- name: Run ESLint
run: just lint
format:
name: Prettier
needs: identifiers
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Just
run: |
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/bin
echo "$HOME/bin" >> $GITHUB_PATH
- name: Check formatting
run: just format
test:
name: Test (Node ${{ matrix.node }})
needs: identifiers
runs-on: ubuntu-24.04
strategy:
matrix:
# Node 22 (LTS), 24 (LTS "Krypton"), 25 (Current)
node: ['22', '24', '25']
fail-fast: false
env:
BASE_REPO: ${{ needs.identifiers.outputs.base_repo }}
BASE_BRANCH: ${{ needs.identifiers.outputs.base_branch }}
PR_NUMBER: ${{ needs.identifiers.outputs.pr_number }}
PR_REPO: ${{ needs.identifiers.outputs.pr_repo }}
PR_BRANCH: ${{ needs.identifiers.outputs.pr_branch }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Just
run: |
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/bin
echo "$HOME/bin" >> $GITHUB_PATH
- name: Install uv (Python package manager)
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Verify toolchain
run: |
node --version
npm --version
python3 --version
just --version
uv --version
- name: Install npm dependencies
run: just install-npm
- name: Install Crossbar.io (test router)
run: just install-crossbar
- name: Start Crossbar.io router
run: |
just crossbar-start &
sleep 5 # Wait for router to start
- name: Run tests
run: just test
- name: Upload test results
if: always()
uses: wamp-proto/wamp-cicd/actions/upload-artifact-verified@main
with:
name: test-results-node-${{ matrix.node }}
path: test-results/
retention-days: 30
- name: Stop Crossbar.io router
if: always()
run: pkill -f crossbar || true
build:
name: Build browser bundles
runs-on: ubuntu-24.04
needs: [identifiers, test]
env:
BASE_REPO: ${{ needs.identifiers.outputs.base_repo }}
BASE_BRANCH: ${{ needs.identifiers.outputs.base_branch }}
PR_NUMBER: ${{ needs.identifiers.outputs.pr_number }}
PR_REPO: ${{ needs.identifiers.outputs.pr_repo }}
PR_BRANCH: ${{ needs.identifiers.outputs.pr_branch }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Just
run: |
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/bin
echo "$HOME/bin" >> $GITHUB_PATH
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Build autobahn
run: just build-autobahn
- name: Build autobahn-xbr
run: just build-xbr
- name: Upload autobahn build artifacts
uses: wamp-proto/wamp-cicd/actions/upload-artifact-verified@main
with:
name: autobahn-browser-bundle
path: packages/autobahn/build/
retention-days: 30
- name: Upload autobahn-xbr build artifacts
uses: wamp-proto/wamp-cicd/actions/upload-artifact-verified@main
with:
name: autobahn-xbr-browser-bundle
path: packages/autobahn-xbr/build/
retention-days: 30
security:
name: Security scan
needs: identifiers
runs-on: ubuntu-24.04
env:
BASE_REPO: ${{ needs.identifiers.outputs.base_repo }}
BASE_BRANCH: ${{ needs.identifiers.outputs.base_branch }}
PR_NUMBER: ${{ needs.identifiers.outputs.pr_number }}
PR_REPO: ${{ needs.identifiers.outputs.pr_repo }}
PR_BRANCH: ${{ needs.identifiers.outputs.pr_branch }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: |
cd packages/autobahn && npm install
cd ../autobahn-xbr && npm install
- name: Run npm audit (autobahn)
run: cd packages/autobahn && npm audit --audit-level=high || true
- name: Run npm audit (autobahn-xbr)
run: cd packages/autobahn-xbr && npm audit --audit-level=high || true