@@ -18,11 +18,17 @@ jobs:
1818 - name : 📥 Checkout
1919 uses : actions/checkout@v4
2020
21- - name : 🟢 Node 12 (build)
21+ - name : 🟢 Node (build)
2222 uses : actions/setup-node@v4
2323 with :
2424 node-version : 20.19.6
2525
26+ - name : Debug OIDC Context
27+ run : |
28+ echo "Repository: $GITHUB_REPOSITORY"
29+ echo "Ref: $GITHUB_REF"
30+ echo "Workflow: $GITHUB_WORKFLOW"
31+
2632 - name : 📚 Install packages
2733 run : |
2834 mkdir -p dist/ion
@@ -32,14 +38,31 @@ jobs:
3238 - name : 🏗️ Build
3339 run : npm run build ion
3440
35- - name : 🟢 Node 24 (publish)
41+ - name : 🟢 Node (publish)
3642 uses : actions/setup-node@v4
3743 with :
3844 node-version : 24.x
3945 registry-url : https://registry.npmjs.org
4046
47+ - name : 🏷️ Determine NPM Tag
48+ id : tag-logic
49+ run : |
50+ TARGET_BRANCH="${{ github.event.release.target_commitish }}"
51+
52+ if [[ "$TARGET_BRANCH" == "main" ]]; then
53+ echo "TAG=latest" >> $GITHUB_OUTPUT
54+ echo "Branch main detectada. Usando tag: latest"
55+ elif [[ "$TARGET_BRANCH" == "support/v19" ]]; then
56+ echo "TAG=v19-lts" >> $GITHUB_OUTPUT
57+ echo "Branch support/v19 detectada. Usando tag: v19-lts"
58+ else
59+ # Fallback de segurança para outras branches (ex: beta, RC)
60+ echo "TAG=next" >> $GITHUB_OUTPUT
61+ echo "Branch $TARGET_BRANCH detectada. Usando tag: next"
62+ fi
63+
4164 - name : 🚀 Publish
42- run : npm publish --provenance --access public --tag v19-lts
65+ run : npm publish --provenance --access public --tag ${{ steps.tag-logic.outputs.TAG }}
4366 working-directory : dist/ion
4467 env :
4568 CI : true
4972 API_KEY="${{ secrets.GOOGLE_CHAT_API_KEY }}"
5073 TOKEN="${{ secrets.GOOGLE_CHAT_TOKEN }}"
5174 SPACE_ID="${{ secrets.SPACE_ID }}"
52- MESSAGE="Ion - Nova versão ${{ github.event.release.tag_name }} disponível !"
75+ MESSAGE="🚀 Ion - Nova versão * ${{ github.event.release.tag_name }}* publicada com sucesso na tag NPM \`${{ steps.tag-logic.outputs.TAG }}\` !"
5376
5477 curl -X POST \
5578 -H "Content-Type: application/json; charset=UTF-8" \
0 commit comments