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
32 changes: 0 additions & 32 deletions .dockerignore

This file was deleted.

105 changes: 85 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,118 @@ on:
- '__tests__/**'
- 'package.json'
- 'yarn.lock'
- 'release.config.js'
- '.github/workflows/ci.yml'
branches:
- '*'
- '**'
- '!master'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI: true

jobs:
CI:
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 20

permissions:
packages: write
contents: write
issues: write
pull-requests: write
id-token: write
packages: write

steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- uses: styfle/cancel-workflow-action@0.12.1
- name: Checkout
uses: actions/checkout@v5
with:
workflow_id: ci.yml
access_token: ${{ github.token }}
fetch-depth: 0
persist-credentials: false

- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 30

- uses: FranzDiebold/github-env-vars-action@v2
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 19
node-version: 24
cache: 'yarn'

- name: Yarn
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Verify dependency integrity
run: yarn audit || true

- name: Lint
run: yarn lint

- name: Test
run: yarn test

- name: Build
run: yarn build

- name: Pre-release (develop branch only)
id: semantic_release
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_NAME: DEV.ME Team
GIT_AUTHOR_EMAIL: support@dev.me
GIT_COMMITTER_NAME: DEV.ME Team
GIT_COMMITTER_EMAIL: support@dev.me
run: |
yarn test
# Install semantic-release and required plugins
npm i -g semantic-release @semantic-release/git @semantic-release/github @semantic-release/changelog @semantic-release/npm @semantic-release/commit-analyzer

# Run semantic-release
npx semantic-release --debug 2>&1 | tee release-output.txt

- name: Release
if: github.ref == 'refs/heads/develop'
# Extract version and tag info from release output
if grep -q "Published release" release-output.txt; then
echo "release_published=true" >> $GITHUB_OUTPUT
VERSION=$(grep -oP 'Published release \K[0-9]+\.[0-9]+\.[0-9]+(-.+)?' release-output.txt | head -1)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
else
echo "release_published=false" >> $GITHUB_OUTPUT
fi

- name: Add Release Summary
if: always()
run: |
npm i -g semantic-release @semantic-release/git @semantic-release/github conventional-changelog-conventionalcommits
npx semantic-release --no-ci --debug
echo "## 📦 Release Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [[ "${{ steps.semantic_release.outputs.release_published }}" == "true" ]]; then
echo "### ✅ Release Published Successfully!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Version:** \`${{ steps.semantic_release.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Tag:** \`${{ steps.semantic_release.outputs.tag }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 🔗 Links" >> $GITHUB_STEP_SUMMARY
echo "- [NPM Package](https://www.npmjs.com/package/@devmehq/sdk-js/v/${{ steps.semantic_release.outputs.version }})" >> $GITHUB_STEP_SUMMARY
echo "- [GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ steps.semantic_release.outputs.tag }})" >> $GITHUB_STEP_SUMMARY
else
echo "### ℹ️ No Release Published" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "No release was created. This could be because:" >> $GITHUB_STEP_SUMMARY
echo "- No relevant commits found for release" >> $GITHUB_STEP_SUMMARY
echo "- Commits don't follow conventional commit format" >> $GITHUB_STEP_SUMMARY
echo "- Release conditions not met" >> $GITHUB_STEP_SUMMARY
fi

echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📊 Build Information" >> $GITHUB_STEP_SUMMARY
echo "- **Workflow:** \`${{ github.workflow }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Run ID:** \`${{ github.run_id }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Run Number:** \`${{ github.run_number }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Actor:** \`${{ github.actor }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Event:** \`${{ github.event_name }}\`" >> $GITHUB_STEP_SUMMARY
101 changes: 84 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,112 @@ on:
branches:
- 'master'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI: true

jobs:
Release:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 20

permissions:
packages: write
contents: write
issues: write
pull-requests: write
id-token: write
packages: write

steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- uses: styfle/cancel-workflow-action@0.12.1
with:
workflow_id: release.yml
access_token: ${{ github.token }}

- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 30
fetch-depth: 0
persist-credentials: false

- uses: FranzDiebold/github-env-vars-action@v2
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 19
node-version: 24
cache: 'yarn'

- name: Yarn
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Verify dependency integrity
run: yarn audit || true

- name: Lint
run: yarn lint

- name: Test
run: |
yarn test
run: yarn test

- name: Build
run: yarn build

- name: Release
id: semantic_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_NAME: DEV.ME Team
GIT_AUTHOR_EMAIL: support@dev.me
GIT_COMMITTER_NAME: DEV.ME Team
GIT_COMMITTER_EMAIL: support@dev.me
run: |
npm i -g semantic-release @semantic-release/git @semantic-release/github conventional-changelog-conventionalcommits
npx semantic-release --no-ci --debug
# Install semantic-release and required plugins
npm i -g semantic-release @semantic-release/git @semantic-release/github @semantic-release/changelog @semantic-release/npm @semantic-release/commit-analyzer

# Run semantic-release
npx semantic-release --debug 2>&1 | tee release-output.txt

# Extract version and tag info from release output
if grep -q "Published release" release-output.txt; then
echo "release_published=true" >> $GITHUB_OUTPUT
VERSION=$(grep -oP 'Published release \K[0-9]+\.[0-9]+\.[0-9]+' release-output.txt | head -1)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
else
echo "release_published=false" >> $GITHUB_OUTPUT
fi

- name: Add Release Summary
if: always()
run: |
echo "## 📦 Release Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [[ "${{ steps.semantic_release.outputs.release_published }}" == "true" ]]; then
echo "### ✅ Release Published Successfully!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Version:** \`${{ steps.semantic_release.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Tag:** \`${{ steps.semantic_release.outputs.tag }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 🔗 Links" >> $GITHUB_STEP_SUMMARY
echo "- [NPM Package](https://www.npmjs.com/package/@devmehq/sdk-js/v/${{ steps.semantic_release.outputs.version }})" >> $GITHUB_STEP_SUMMARY
echo "- [GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ steps.semantic_release.outputs.tag }})" >> $GITHUB_STEP_SUMMARY
else
echo "### ℹ️ No Release Published" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "No release was created. This could be because:" >> $GITHUB_STEP_SUMMARY
echo "- No relevant commits found for release" >> $GITHUB_STEP_SUMMARY
echo "- Commits don't follow conventional commit format" >> $GITHUB_STEP_SUMMARY
echo "- Release conditions not met" >> $GITHUB_STEP_SUMMARY
fi

echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📊 Build Information" >> $GITHUB_STEP_SUMMARY
echo "- **Workflow:** \`${{ github.workflow }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Run ID:** \`${{ github.run_id }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Run Number:** \`${{ github.run_number }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Actor:** \`${{ github.actor }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Event:** \`${{ github.event_name }}\`" >> $GITHUB_STEP_SUMMARY
7 changes: 0 additions & 7 deletions .lintstagedrc

This file was deleted.

29 changes: 0 additions & 29 deletions .mocharc.js

This file was deleted.

6 changes: 0 additions & 6 deletions .npmrc

This file was deleted.

Loading
Loading