File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -169,9 +169,22 @@ jobs:
169
169
pattern : SwiftFormat-for-Xcode
170
170
- name : Display structure of downloaded files
171
171
run : ls -R downloaded_artifacts
172
+ - name : Get Release ID
173
+ id : get-release-id
174
+ run : |
175
+ if [ -n "${{ github.event.release.id }}" ]; then
176
+ echo "release-id=${{ github.event.release.id }}" >> $GITHUB_OUTPUT
177
+ else
178
+ TAG="${{ inputs.tag }}"
179
+ RELEASE_ID=$(gh api repos/${{ github.repository }}/releases/tags/$TAG --jq '.id')
180
+ echo "release-id=$RELEASE_ID" >> $GITHUB_OUTPUT
181
+ fi
182
+ env :
183
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
172
184
- name : Upload release assets
173
185
uses : skx/github-action-publish-binaries@master
174
186
env :
175
187
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
176
188
with :
177
- args : ' downloaded_artifacts/SwiftFormat-for-Xcode/SwiftFormat.for.Xcode.app.zip'
189
+ releaseId : ${{ steps.get-release-id.outputs.release-id }}
190
+ args : ' downloaded_artifacts/SwiftFormat.for.Xcode.app.zip'
Original file line number Diff line number Diff line change @@ -94,13 +94,26 @@ jobs:
94
94
run : ls -R downloaded-artifacts
95
95
- name : Move MSI files to workspace root
96
96
run : |
97
- mv downloaded-artifacts/*/* .msi ./
97
+ mv downloaded-artifacts/*.msi ./
98
98
rm -rf downloaded-artifacts
99
99
- name : Display structure of uploadable files
100
100
run : ls -R .
101
+ - name : Get Release ID
102
+ id : get-release-id
103
+ run : |
104
+ if [ -n "${{ github.event.release.id }}" ]; then
105
+ echo "release-id=${{ github.event.release.id }}" >> $GITHUB_OUTPUT
106
+ else
107
+ TAG="${{ inputs.tag }}"
108
+ RELEASE_ID=$(gh api repos/${{ github.repository }}/releases/tags/$TAG --jq '.id')
109
+ echo "release-id=$RELEASE_ID" >> $GITHUB_OUTPUT
110
+ fi
111
+ env :
112
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
101
113
- name : Upload release assets
102
114
uses : skx/github-action-publish-binaries@master
103
115
env :
104
116
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
105
117
with :
118
+ releaseId : ${{ steps.get-release-id.outputs.release-id }}
106
119
args : ' SwiftFormat.*.msi'
You can’t perform that action at this time.
0 commit comments