Run CI, releases and Renovate on Gitea
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['v[0-9]+.[0-9]+.[0-9]+']
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@v7.0.0
|
||||
with:
|
||||
cache: npm
|
||||
node-version: 24.18.0
|
||||
registry-url: https://registry.npmjs.org
|
||||
- run: npm ci
|
||||
- name: The tag must match the version being published
|
||||
run: |
|
||||
tagged="${GITHUB_REF_NAME#v}"
|
||||
packaged="$(node -p 'require("./package.json").version')"
|
||||
test "$tagged" = "$packaged" || {
|
||||
echo "tag $GITHUB_REF_NAME does not match package.json $packaged"
|
||||
exit 1
|
||||
}
|
||||
- run: npm run lint
|
||||
- run: npm test
|
||||
- run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
@@ -0,0 +1,25 @@
|
||||
name: Renovate
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '43 4 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: docker-host
|
||||
steps:
|
||||
- name: Run Renovate against this repo
|
||||
env:
|
||||
GITHUB_COM_TOKEN: ${{ secrets.RENOVATE_GITHUB_TOKEN }}
|
||||
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
|
||||
run: |
|
||||
docker run --rm \
|
||||
-e GITHUB_COM_TOKEN \
|
||||
-e LOG_LEVEL=info \
|
||||
-e RENOVATE_ENDPOINT=https://gitea.larvit.se/api/v1 \
|
||||
-e RENOVATE_GIT_AUTHOR="Renovate Bot <renovate@larvit.se>" \
|
||||
-e RENOVATE_PLATFORM=gitea \
|
||||
-e RENOVATE_REPOSITORIES=${{ github.repository }} \
|
||||
-e RENOVATE_TOKEN \
|
||||
renovate/renovate:44.39.2
|
||||
@@ -0,0 +1,43 @@
|
||||
name: Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@v7.0.0
|
||||
with:
|
||||
cache: npm
|
||||
node-version: 24.18.0
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
- run: npm run build
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# The floor in package.json engines, every LTS above it, and current.
|
||||
node: ['18', '20', '22', '24', '26']
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@v7.0.0
|
||||
with:
|
||||
cache: npm
|
||||
node-version: ${{ matrix.node }}
|
||||
- run: npm ci
|
||||
# Compiled rather than type-stripped: Node 18 and 20 cannot run TypeScript directly.
|
||||
- run: npm run test:compiled
|
||||
Reference in New Issue
Block a user