Merge pull request #12 from swarnendu19/developer #6
This file contains 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 Packages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout repository | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
# Step 2: Setup Node.js environment | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x # Use your preferred Node.js version | |
# Step 3: Install dependencies for the Turborepo | |
- name: Install Dependencies | |
run: npm install | |
# Step 4: Build the paysync package located in packages/node | |
- name: Build paysync package | |
run: npx turbo run build --filter=paysync | |
# Step 5: Create Release PR or Publish to npm using Changesets | |
- name: Create Release PR or Publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: npm | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Your npm authentication token | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token for PRs | |
# Step 6: Publish the package to npm if changesets detected a new release | |
- name: Publish to npm | |
if: steps.changesets.outputs.published == 'true' | |
run: | | |
cd packages/node | |
npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |