feat: enhance IP address retrieval by adding support for x-real-ip he… #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| validate-and-release: | |
| name: Validate & Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build package | |
| run: pnpm build | |
| - name: Validate build output | |
| run: | | |
| if [ ! -f "dist/index.js" ] || [ ! -f "dist/index.cjs" ] || [ ! -f "dist/index.d.ts" ]; then | |
| echo "❌ Build output missing required files" | |
| exit 1 | |
| fi | |
| echo "✅ Build output validated" | |
| - name: Security audit | |
| run: pnpm audit --audit-level moderate | |
| - name: Create Release Pull Request or Publish | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| publish: pnpm release | |
| version: pnpm version | |
| commit: 'chore: release package' | |
| title: 'chore: release package' | |
| createGithubReleases: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Release Summary | |
| if: steps.changesets.outputs.published == 'true' | |
| run: | | |
| echo "🎉 Package published successfully!" | |
| echo "Published packages: ${{ steps.changesets.outputs.publishedPackages }}" | |
| - name: Notify on Failure | |
| if: failure() | |
| run: | | |
| echo "❌ Release workflow failed" | |
| echo "Please check the logs and fix any issues before retrying" |