Skip to content

Commit b20e84a

Browse files
committed
Fix release artifact jobs
1 parent faf0e04 commit b20e84a

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.github/workflows/notarize.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,22 @@ jobs:
169169
pattern: SwiftFormat-for-Xcode
170170
- name: Display structure of downloaded files
171171
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 }}
172184
- name: Upload release assets
173185
uses: skx/github-action-publish-binaries@master
174186
env:
175187
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
176188
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'

.github/workflows/windows_release.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,26 @@ jobs:
9494
run: ls -R downloaded-artifacts
9595
- name: Move MSI files to workspace root
9696
run: |
97-
mv downloaded-artifacts/*/*.msi ./
97+
mv downloaded-artifacts/*.msi ./
9898
rm -rf downloaded-artifacts
9999
- name: Display structure of uploadable files
100100
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 }}
101113
- name: Upload release assets
102114
uses: skx/github-action-publish-binaries@master
103115
env:
104116
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105117
with:
118+
releaseId: ${{ steps.get-release-id.outputs.release-id }}
106119
args: 'SwiftFormat.*.msi'

0 commit comments

Comments
 (0)