fix: declare defu and h3 as peerDependencies #80
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: Publish to GitHub Packages | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'pnpm' | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@interline-io' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Compute version and tags | |
| id: meta | |
| run: | | |
| SHORT_SHA=$(git rev-parse --short HEAD) | |
| BRANCH=$(echo "${{ github.ref_name }}" | sed 's/[^a-zA-Z0-9._-]/-/g' | sed 's/^-//') | |
| BASE_VERSION=$(node -p "require('./package.json').version") | |
| if [ "${{ github.ref_name }}" = "main" ]; then | |
| echo "version=${BASE_VERSION}-sha.${SHORT_SHA}" >> $GITHUB_OUTPUT | |
| echo "tag=sha-${SHORT_SHA}" >> $GITHUB_OUTPUT | |
| else | |
| echo "version=${BASE_VERSION}-branch.${BRANCH}.${SHORT_SHA}" >> $GITHUB_OUTPUT | |
| echo "tag=${BRANCH}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Set version | |
| run: npm version ${{ steps.meta.outputs.version }} --no-git-tag-version | |
| - name: Build | |
| run: pnpm prepack | |
| - name: Publish | |
| run: npm publish --tag ${{ steps.meta.outputs.tag }} | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Add latest tag | |
| if: github.ref_name == 'main' | |
| run: npm dist-tag add @interline-io/tlv2-ui@${{ steps.meta.outputs.version }} latest | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |