Bump tmp and nx #109
Workflow file for this run
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: Docker | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*.*.*' | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Get version | |
| id: get_version | |
| run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'npm' | |
| - name: Restore | |
| run: npm install | |
| - name: Build | |
| run: npm run build | |
| - name: Lint | |
| run: npm run lint | |
| - name: Test | |
| run: npm test | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| if: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }} | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: btburnett3/couchbase-index-manager | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}},prefix= | |
| type=semver,pattern={{major}}.{{minor}},prefix= | |
| - name: Docker Build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| annotations: ${{ steps.meta.outputs.annotations }} | |
| provenance: true | |
| sbom: true | |
| cache-to: type=inline | |
| cache-from: type=registry,ref=brantburnett/couchbase-index-manager:main | |
| - name: Publish to NPM | |
| if: startsWith(github.ref, 'refs/tags/') # Only on tags | |
| run: | | |
| VERSION="${{ steps.get_version.outputs.RELEASE_VERSION }}" | |
| # Determine npm tag based on version | |
| if [[ $VERSION == *"-"* ]]; then | |
| # Extract prerelease identifier (e.g., "beta" from "2.2.0-beta0002") | |
| PRERELEASE="${VERSION#*-}" | |
| TAG=$(echo "$PRERELEASE" | sed 's/[0-9]*$//') | |
| else | |
| TAG="latest" | |
| fi | |
| npm run lerna -- version $VERSION --no-git-tag-version --exact -y && | |
| pushd packages/couchbase-index-manager && npm publish --access public --tag $TAG && popd && | |
| pushd packages/couchbase-index-manager-cli && npm publish --access public --tag $TAG && popd | |
| env: | |
| NPM_CONFIG_PROVENANCE: true | |
| - name: Pack NPM | |
| if: ${{!startsWith(github.ref, 'refs/tags/')}} # Only on non-tags | |
| run: | | |
| pushd packages/couchbase-index-manager && npm pack && popd && | |
| pushd packages/couchbase-index-manager-cli && npm pack && popd | |
| - name: Archive | |
| if: ${{!startsWith(github.ref, 'refs/tags/')}} # Only on non-tags | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: npm-packages | |
| path: | | |
| packages/couchbase-index-manager/*.tgz | |
| packages/couchbase-index-manager-cli/*.tgz |