Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .github/workflows/release.yml.disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Release

on:
push:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22]
elasticsearch-version: ['8.15.0', '9.0.0']

name: Node ${{ matrix.node-version }} - ES ${{ matrix.elasticsearch-version }}

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Start Elasticsearch ${{ matrix.elasticsearch-version }}
run: |
docker run -d \
--name elasticsearch \
-p 9200:9200 \
-e "discovery.type=single-node" \
-e "xpack.security.enabled=false" \
-e "xpack.security.enrollment.enabled=false" \
docker.elastic.co/elasticsearch/elasticsearch:${{ matrix.elasticsearch-version }}

- name: Wait for Elasticsearch
run: |
echo "Waiting for Elasticsearch to be ready..."
for i in {1..60}; do
# Check cluster health status
HEALTH=$(curl -s "http://localhost:9200/_cluster/health" 2>/dev/null || echo "")
if [ ! -z "$HEALTH" ]; then
STATUS=$(echo $HEALTH | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
echo "Attempt $i: Cluster status is '$STATUS'"

# Wait for yellow or green status (yellow is ok for single-node)
if [ "$STATUS" = "yellow" ] || [ "$STATUS" = "green" ]; then
echo "Elasticsearch is ready!"
# Give it a bit more time to fully stabilize
sleep 5
curl -s "http://localhost:9200/_cluster/health?pretty"
break
fi
else
echo "Attempt $i: Elasticsearch not responding yet..."
fi

if [ $i -eq 60 ]; then
echo "ERROR: Elasticsearch failed to become ready after 5 minutes"
docker logs elasticsearch
exit 1
fi

sleep 5
done

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Run tests
run: |
ES_VERSION=${{ matrix.elasticsearch-version }} \
ELASTICSEARCH_URL=http://localhost:9200 \
npm run mocha

release:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 22

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
17 changes: 17 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md", "package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ npm install feathers-elasticsearch @elastic/elasticsearch --save
**Requirements:**
- Feathers v5+
- Elasticsearch 8.x or 9.x (5.x, 6.x, 7.x also supported)
- Node.js 18+
- Node.js 20+

## Quick Start

Expand Down
Loading