|
20 | 20 | - name: Checkout |
21 | 21 | uses: actions/checkout@v4 |
22 | 22 |
|
23 | | - - name: Get Release data |
24 | | - id: get_release_data |
25 | | - if: github.ref_type == 'tag' |
26 | | - run: | |
27 | | - MESSAGE=$(git tag -l --format='%(contents)' "${GITHUB_REF_NAME}") |
28 | | - echo "$MESSAGE" >> release-message.txt |
29 | | - cat release-message.txt |
30 | | -
|
31 | | - NPM_TAG="latest" |
32 | | - if [[ "${GITHUB_REF_NAME}" == *-* ]]; then |
33 | | - NPM_TAG="next" |
34 | | - fi |
35 | | - echo "NPM_TAG=${NPM_TAG}" >> $GITHUB_ENV |
36 | | - env: |
37 | | - GITHUB_REF_NAME: ${{ github.ref_name }} |
38 | | - |
39 | 23 | - name: Setup node |
40 | 24 | uses: actions/setup-node@v4 |
41 | 25 | with: |
@@ -71,23 +55,41 @@ jobs: |
71 | 55 | working-directory: ./out |
72 | 56 | run: npx turbo verify |
73 | 57 |
|
74 | | - - name: Create GitHub Release |
| 58 | + - name: Get Release data |
| 59 | + id: get_release_data |
75 | 60 | if: github.ref_type == 'tag' |
76 | | - id: gh-release |
77 | | - uses: softprops/action-gh-release@v2 |
78 | | - with: |
79 | | - body_path: release-message.txt |
80 | | - make_latest: ${{ steps.get_release_data.outputs.NPM_TAG == 'latest' }} |
| 61 | + run: | |
| 62 | + MESSAGE=$(git tag -l --format='%(contents)' "${GITHUB_REF_NAME}") |
| 63 | + echo "$MESSAGE" >> release-message.txt |
| 64 | + cat release-message.txt |
| 65 | +
|
| 66 | + NPM_TAG="latest" |
| 67 | + if [[ "${GITHUB_REF_NAME}" == *-* ]]; then |
| 68 | + prerelease=$(echo "$GITHUB_REF_NAME" | cut -d'-' -f2 | cut -d'.' -f1) |
| 69 | + NPM_TAG=${prerelease:-next} |
| 70 | + fi |
| 71 | + echo "NPM_TAG=${NPM_TAG}" >> $GITHUB_ENV |
| 72 | + env: |
| 73 | + GITHUB_REF_NAME: ${{ github.ref_name }} |
81 | 74 |
|
82 | 75 | - name: Publish on JSR - Core |
83 | 76 | working-directory: ./out/packages/core |
84 | 77 | continue-on-error: true |
85 | | - run: npx -y jsr publish --token ${{ secrets.JSR_API_TOKEN }} --allow-slow-types |
| 78 | + run: npx -y jsr publish --token ${{ secrets.JSR_API_TOKEN }} --allow-slow-types --allow-dirty |
86 | 79 |
|
87 | 80 | - name: Publish on NPM |
88 | 81 | working-directory: ./out |
89 | 82 | run: | |
90 | | - NPM_TAG="${{ steps.get_release_data.outputs.NPM_TAG || 'latest' }}" |
91 | | - yarn workspaces foreach -A --no-private npm publish --tolerate-republish --tag $NPM_TAG |
| 83 | + NPM_TAG=${{ steps.get_release_data.outputs.NPM_TAG }} |
| 84 | + echo "Publishing with tag: $NPM_TAG" |
| 85 | + yarn workspaces foreach -A --no-private npm publish --tolerate-republish --tag ${NPM_TAG:-latest} |
92 | 86 | env: |
93 | 87 | NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |
| 88 | + |
| 89 | + - name: Create GitHub Release |
| 90 | + if: github.ref_type == 'tag' |
| 91 | + id: gh-release |
| 92 | + uses: softprops/action-gh-release@v2 |
| 93 | + with: |
| 94 | + body_path: release-message.txt |
| 95 | + make_latest: ${{ steps.get_release_data.outputs.NPM_TAG == 'latest' }} |
0 commit comments