Skip to content

Commit

Permalink
feat: configure semantic release with branches and plugins
Browse files Browse the repository at this point in the history
chore: update TypeScript configuration for improved compatibility
chore: modify GitHub Actions workflow for semantic release setup
refactor: remove outdated TypeScript declaration file
  • Loading branch information
bucurdavid committed Feb 14, 2025
1 parent dc19ca8 commit 152d5f6
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 1,005 deletions.
32 changes: 12 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: '20.3.x'
node-version: '23.3.x'
registry-url: https://registry.npmjs.org/

- name: Install pnpm
Expand Down Expand Up @@ -60,29 +63,18 @@ jobs:
pnpm run build:stable
fi
- name: Create Release
- name: Setup Semantic Release
run: |
pnpm add -D semantic-release @semantic-release/git @semantic-release/github conventional-changelog-conventionalcommits
- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
VERSION=v$(node -p "require('./package.json').version")
RELEASE_TYPE="${{ steps.release_type.outputs.type }}"
if [[ "$RELEASE_TYPE" == "alpha" ]]; then
VERSION="${VERSION}-alpha"
fi
echo "Creating release for $VERSION"
gh release create $VERSION \
--title "$VERSION" \
--generate-notes \
--prerelease $([[ "$RELEASE_TYPE" == "alpha" ]] && echo "true" || echo "false")
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
if [[ "${{ steps.release_type.outputs.type }}" == "alpha" ]]; then
pnpm publish --access=public --tag alpha
npx semantic-release --branches develop --preset conventionalcommits --prerelease alpha
else
pnpm publish --access=public
npx semantic-release --branches main --preset conventionalcommits
fi
13 changes: 13 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"branches": [
"main",
{"name": "develop", "prerelease": "alpha"}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
"@semantic-release/git"
]
}
73 changes: 0 additions & 73 deletions dist/index.d.ts

This file was deleted.

Loading

0 comments on commit 152d5f6

Please sign in to comment.