-
Notifications
You must be signed in to change notification settings - Fork 14
89 lines (84 loc) · 2.65 KB
/
release.yml
File metadata and controls
89 lines (84 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Release
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
name: Build for macos-universal
runs-on: macos-14
steps:
- name: Set Xcode version
run: sudo xcode-select -s /Applications/Xcode_16.2.app
- uses: swift-actions/setup-swift@v2
with:
swift-version: "6.0"
- uses: actions/checkout@v4
- name: Install the binary
run: ./install.sh
- name: Upload the binary
uses: actions/upload-artifact@v4
with:
path: xcode-selective-test.tar.gz
name: xcode-selective-test
check-portability:
needs: build
name: TestRun on ${{ matrix.destination.os }} for macos-universal
runs-on: ${{ matrix.destination.os }}
strategy:
matrix:
destination:
- { os: macos-15 }
- { os: macos-14 }
- { os: macos-13 }
steps:
- uses: actions/download-artifact@v4
with:
name: xcode-selective-test
- name: Unpack the binary
run: tar -xvf xcode-selective-test.tar.gz
- name: Run the binary
run: ./xcode-selective-test -h
make-artifact-bundle:
needs: [build, check-portability]
runs-on: ubuntu-latest
outputs:
checksum: ${{ steps.checksum.outputs.checksum }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: xcode-selective-test
- run: ./spm-artifact-bundle.sh ${{ github.event.release.tag_name || github.ref_name }}
- name: Upload artifact bundle
uses: actions/upload-artifact@v4
with:
name: xcode-selective-test.artifactbundle.zip
path: xcode-selective-test.artifactbundle.zip
- name: Compute checksum
id: checksum
run: echo "checksum=$(swift package compute-checksum xcode-selective-test.artifactbundle.zip)" >> "$GITHUB_OUTPUT"
deploy-binary:
if: ${{ github.event_name == 'release' }}
needs: [check-portability, make-artifact-bundle]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Deploy the binary
uses: softprops/action-gh-release@v2
with:
body: |
### Binary artifactbundle
```swift
.binaryTarget(
name: "xcode-selective-test",
url: "https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/xcode-selective-test.artifactbundle.zip",
checksum: "${{ needs.make-artifact-bundle.outputs.checksum }}"
)
```
append_body: true
files: |
xcode-selective-test.tar.gz
xcode-selective-test.artifactbundle.zip