Skip to content

Commit a53cf97

Browse files
committed
Update swift-format.yml
Create a prerelease blob instead of an artifact. Enable running tests.
1 parent 9fc0075 commit a53cf97

File tree

1 file changed

+30
-13
lines changed

1 file changed

+30
-13
lines changed

.github/workflows/swift-format.yml

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
name: swift-format
22

33
on:
4-
pull_request:
5-
branches:
6-
- main
7-
84
workflow_dispatch:
95

106
jobs:
11-
windows_5_5:
7+
windows:
128
runs-on: windows-latest
139

10+
strategy:
11+
matrix:
12+
include:
13+
- tag: 5.5-DEVELOPMENT-SNAPSHOT-2021-05-02-a
14+
branch: swift-5.5-branch
15+
1416
steps:
1517
- uses: actions/checkout@v2
1618
with:
1719
fetch-depth: 1
18-
# repository: apple/swift-format
19-
repository: compnerd/swift-format
20-
ref: async
20+
repository: apple/swift-format
2121

2222
- uses: seanmiddleditch/gha-setup-vsdevenv@master
2323

24-
- name: Install Swift v5.5 (2021-04-19 Snapshot)
24+
- name: Install Swift ${{ matrix.tag }}
2525
run: |
26-
Install-Binary -Url "https://swift.org/builds/swift-5.5-branch/windows10/swift-5.5-DEVELOPMENT-SNAPSHOT-2021-04-19-a/swift-5.5-DEVELOPMENT-SNAPSHOT-2021-04-19-a-windows10.exe" -Name "installer.exe" -ArgumentList ("-q")
26+
Install-Binary -Url "https://swift.org/builds/${{ matrix.branch }}/windows10/swift-${{ matrix.tag }}/swift-${{ matrix.tag }}-windows10.exe" -Name "installer.exe" -ArgumentList ("-q")
2727
- name: Set Environment Variables
2828
run: |
2929
echo "SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
@@ -39,11 +39,28 @@ jobs:
3939
Copy-Item "$env:SDKROOT\usr\share\visualc.apinotes" -destination "$env:VCToolsInstallDir\include\visualc.apinotes"
4040
Copy-Item "$env:SDKROOT\usr\share\winsdk.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\um\module.modulemap"
4141
42+
- name: test
43+
run: |
44+
swift test -Xcc -IC:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\include -Xlinker -LC:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\lib
45+
4246
- name: build
4347
run: |
4448
swift build -c release -Xcc -IC:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\include -Xlinker -LC:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\lib
4549
46-
- uses: actions/upload-artifact@v2
50+
- uses: actions/create-release@v1
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
id: create_release
54+
with:
55+
draft: true
56+
prerelease: true
57+
release_name: swift-format-${{ matrix.tag }}
58+
tag_name: swift-format-${{ matrix.tag }}
59+
- uses: actions/[email protected]
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4762
with:
48-
name: swift-format
49-
path: .build\x86_64-unknown-windows-msvc\release\swift-format.exe
63+
asset_content_type: application/octet-stream
64+
asset_name: swift-format.exe
65+
asset_path: .build\x86_64-unknown-windows-msvc\release\swift-format.exe
66+
upload_url: ${{ steps.create_release.outputs.upload_url }}

0 commit comments

Comments
 (0)