Add appsflyer UDL listeners (#126) #24
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: NPM Publish | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Update npm to latest | |
| run: npm install -g npm@latest | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Build | |
| run: npm run build | |
| - name: Check if version is published | |
| id: check-version | |
| run: | | |
| PACKAGE_VERSION=$(node -p "require('./package.json').version") | |
| echo "Current version: $PACKAGE_VERSION" | |
| if npm view . versions --json | grep -q "\"$PACKAGE_VERSION\""; then | |
| echo "Version $PACKAGE_VERSION already published, skipping" | |
| echo "is_published=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "Version $PACKAGE_VERSION not published yet" | |
| echo "is_published=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Publish to NPM | |
| if: steps.check-version.outputs.is_published == 'false' | |
| run: npm publish --provenance |