1+ name : NPM package
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ branch :
7+ description : ' Branch to build'
8+ required : true
9+ default : ' main'
10+
11+ jobs :
12+ build :
13+ runs-on : ubuntu-latest
14+
15+ permissions :
16+ contents : read
17+ packages : write
18+
19+ steps :
20+ - name : Checkout code
21+ uses : actions/checkout@v4
22+ with :
23+ ref : ${{ github.event.inputs.branch }}
24+
25+ - name : Sync pip requirements
26+ run : curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/.github/workflows/requirements-runner.txt
27+ working-directory : .github/workflows
28+
29+ - name : Setup Python and pip
30+ uses : actions/setup-python@v4
31+ with :
32+ python-version : 3.11.x
33+ cache : pip
34+ cache-dependency-path : .github/workflows/requirements-runner.txt
35+
36+ - name : Install Python requirements and Create default Conan profile
37+ run : pip install -r .github/workflows/requirements-runner.txt
38+
39+ - name : Install Linux system requirements for building
40+ run : |
41+ mkdir runner_scripts
42+ cd runner_scripts
43+ curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/ubuntu_setup.sh
44+ chmod +x ubuntu_setup.sh
45+ sudo ./ubuntu_setup.sh
46+
47+ - name : Setup pipeline caches
48+ run : |
49+ mkdir -p /home/runner/.conan/downloads
50+ mkdir -p /home/runner/.conan/data
51+
52+ - name : Create default Conan profile
53+ run : conan profile new default --detect
54+
55+ # FIXME: Once merged to main: conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}"
56+ - name : Get Conan configuration
57+ run : |
58+ conan config install https://github.com/Ultimaker/conan-config.git
59+ conan config install https://github.com/Ultimaker/conan-config.git -a "-b NP-419"
60+
61+ - name : Add runner credentials to cura remote
62+ run : conan user -p ${{ secrets.CONAN_PASS }} -r cura ${{ secrets.CONAN_USER }}
63+
64+ - name : Cache Conan packages
65+ uses : actions/cache@v3
66+ with :
67+ path : /home/runner/.conan/data
68+ key : ${{ runner.os }}-conan-data-${{ github.run_id }}
69+ restore-keys : |
70+ ${{ runner.os }}-conan-data-
71+
72+ - name : Cache Conan downloads
73+ uses : actions/cache@v3
74+ with :
75+ path : /home/runner/.conan/downloads
76+ key : ${{ runner.os }}-conan-downloads-${{ github.run_id }}
77+ restore-keys : |
78+ ${{ runner.os }}-conan-downloads-
79+
80+ - name : Use Node.js
81+ uses : actions/setup-node@v4
82+ with :
83+ node-version-file : .nvmrc
84+ registry-url : ' https://npm.pkg.github.com'
85+ scope : ' @ultimaker'
86+
87+ - name : Set npm config
88+ run : |
89+ npm run install_curaengine
90+ npm ci
91+ npm publish
92+ env :
93+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
94+
95+ - name : Upload the Package(s)
96+ if : ${{ always() }}
97+ run : |
98+ conan remove "cura_private_data/*" --force
99+ conan remove "fdm_materials/*" --force
100+ conan upload "*" -r cura --all -c
0 commit comments