diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 99b550331e..b1f5347040 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -11,26 +11,41 @@ on: jobs: publish: - if: ${{ startsWith(github.ref, 'refs/tags/') }} name: Publish package runs-on: ubuntu-24.04 steps: - name: Clone repository uses: actions/checkout@v4 + - name: Fetch tags + run: git fetch --tags + + - name: Check if commit has a tag + id: check_tag + run: | + if [ -n "$(git tag --points-at HEAD)" ]; then + echo "has_tag=true" >> $GITHUB_ENV + else + echo "has_tag=false" >> $GITHUB_ENV + fi + - name: Enable Corepack + if: env.has_tag == 'true' run: corepack enable - name: Configure Node.js + if: env.has_tag == 'true' uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: 'yarn' - name: Install dependencies + if: env.has_tag == 'true' run: yarn --immutable --inline-builds - name: Build + if: env.has_tag == 'true' run: yarn build # - name: Authenticate npm