fixup! Chore(ci): Check if branch has tag for publishing #1423
Workflow file for this run
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: Publish | |
on: | |
push: | |
branches: | |
- chore/DS-1434-prerelease | |
- main | |
- release/next | |
- release/alpha | |
- release/beta | |
jobs: | |
hasTag: | |
name: 🏷️ Analyze Tags | |
runs-on: ubuntu-24.04 | |
outputs: | |
hasTag: ${{ steps.checkTagExists.outputs.has-tag }} | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Fetch tags | |
run: git fetch --tags | |
- run: git tag --points-at HEAD | |
- name: Check Tag On Commit | |
id: checkTagExists | |
run: | | |
if [ -n "$(git tag --points-at HEAD)" ]; then | |
echo "has-tag=true" | |
else | |
echo "has-tag=false" | |
fi | |
- name: Debug2 | |
run: echo "${{ steps.checkTagExists.outputs.has-tag }}" | |
publish: | |
name: 🚀 📦 Publish Package | |
needs: hasTag | |
if: ${{ needs.hasTag.outputs.hasTag == 'true' }} | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Configure Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn --immutable --inline-builds | |
- name: Build | |
run: yarn build | |
# - name: Authenticate npm | |
# run: ./bin/ci/npm-auth.sh | |
# env: | |
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# - name: Publish | |
# run: make publish | |
# env: | |
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |