diff --git a/.gitea/workflows/app_template.yml b/.gitea/workflows/app_template.yml index 2f5ef59..927773e 100644 --- a/.gitea/workflows/app_template.yml +++ b/.gitea/workflows/app_template.yml @@ -30,9 +30,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: skjnldsv/read-package-engines-version-actions@v3 + id: versions + with: + fallbackNode: '^20' + fallbackNpm: '^10' - uses: actions/setup-node@v4 with: - node-version: "^20" + node-version: ${{ steps.versions.outputs.nodeVersion }} + - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' - run: npm ci - run: npm run lint - run: npm run stylelint @@ -48,9 +54,15 @@ jobs: - uses: actions/checkout@v4 - run: curl -sSLo /usr/local/bin/composer https://getcomposer.org/download/latest-stable/composer.phar - run: chmod +x /usr/local/bin/composer + - uses: skjnldsv/read-package-engines-version-actions@v3 + id: versions + with: + fallbackNode: '^20' + fallbackNpm: '^10' - uses: actions/setup-node@v4 with: - node-version: "^20" + node-version: ${{ steps.versions.outputs.nodeVersion }} + - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' - run: make dist - uses: akkuman/gitea-release-action@v1 with: diff --git a/Makefile b/Makefile index 1adf407..c6d23db 100644 --- a/Makefile +++ b/Makefile @@ -128,7 +128,7 @@ dev: build docker rm $(app_name) || true docker build -t $(app_name) . docker run -itd --rm --name $(app_name) -v $(CURDIR):/var/www/html/apps/$(app_name) -p 80:80 $(app_name) - npm run watch + npm run watch || docker stop $(app_name) # Generate translations .PHONY: l10n diff --git a/package.json b/package.json index 7c1d074..c21ac4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,10 @@ { "name": "app_template", "license": "AGPL-3.0-or-later", + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + }, "scripts": { "build": "vite build", "dev": "vite --mode development build",