3333 github.event_name == 'workflow_dispatch'
3434 outputs :
3535 hasChangesets : ${{ steps.changeset-check.outputs.hasChangesets }}
36- newVersion : ${{ steps.version.outputs.newVersion }}
37- currentVersion : ${{ steps.current-version.outputs.currentVersion }}
3836 steps :
3937 - uses : actions/checkout@v4
4038 with :
8078
8179 - name : Get current version (if no changesets)
8280 if : steps.changeset-check.outputs.hasChangesets == 'false'
83- id : current-version
8481 run : |
8582 CURRENT_VERSION=$(node -p "require('./package.json').version")
86- echo "currentVersion=$CURRENT_VERSION" >> "$GITHUB_OUTPUT"
8783 echo "📦 Current version: $CURRENT_VERSION"
8884
8985 - name : Commit and Push (with version bump)
@@ -104,7 +100,8 @@ jobs:
104100 steps :
105101 - uses : actions/checkout@v4
106102 with :
107- fetch-depth : 0
103+ fetch-depth : 1
104+ ref : ' main'
108105
109106 - uses : pnpm/action-setup@v4
110107 name : Install pnpm
@@ -123,24 +120,34 @@ jobs:
123120 run : |
124121 pnpm run zip:all
125122
123+ - name : Get Version
124+ id : version
125+ run : |
126+ pnpm changeset version
127+ NEW_VERSION=$(node -p "require('./package.json').version")
128+ echo "newVersion=$NEW_VERSION" >> "$GITHUB_OUTPUT"
129+ echo "📦 New version: $NEW_VERSION"
130+
126131 - name : Create GitHub Release (with version bump)
127132 if : ${{ needs.changeset_check.outputs.hasChangesets == 'true' }}
128133 uses : softprops/action-gh-release@v1
129134 with :
130- tag_name : v${{ needs.changeset_check .outputs.newVersion }}
131- name : amgiflol@${{ needs.changeset_check .outputs.newVersion }}
135+ tag_name : v${{ steps.version .outputs.newVersion }}
136+ name : amgiflol@${{ steps.version .outputs.newVersion }}
132137 body_path : CHANGELOG.md
133138 files : |
134139 dist/*.zip
135140 draft : false
136141 prerelease : false
142+ env :
143+ NEW_VERSION : ${{ steps.version.outputs.newVersion }}
137144
138145 - name : Create GitHub Release (no version bump)
139146 if : ${{ needs.changeset_check.outputs.hasChangesets == 'false' }}
140147 uses : softprops/action-gh-release@v1
141148 with :
142- tag_name : v${{ needs.changeset_check .outputs.currentVersion }}
143- name : amgiflol@${{ needs.changeset_check .outputs.currentVersion }}
149+ tag_name : v${{ steps.version .outputs.newVersion }}
150+ name : amgiflol@${{ steps.version .outputs.newVersion }}
144151 body_path : CHANGELOG.md
145152 files : |
146153 dist/*.zip
0 commit comments