1+ name : Release
2+
3+ on :
4+ workflow_dispatch :
5+ release :
6+ types : [published]
7+
8+ jobs :
9+ build :
10+ name : Build for ${{ matrix.destination.name }}
11+ runs-on : ${{ matrix.destination.os }}
12+ strategy :
13+ matrix :
14+ destination :
15+ - { name: "ubuntu-aarch64", os: ubuntu-22.04-arm }
16+ - { name: "ubuntu-x86_64", os: ubuntu-22.04 }
17+ - { name: "macos-universal", os: macos-15 }
18+ steps :
19+ - if : startsWith(matrix.destination.name, 'ubuntu')
20+ uses : vapor/swiftly-action@v0.2
21+ with :
22+ toolchain : 6.1.0
23+ - if : startsWith(matrix.destination.name, 'macos')
24+ run : sudo xcode-select -s /Applications/Xcode_16.4.app
25+ - uses : actions/checkout@v4
26+ - name : Create the binary
27+ run : make release OUTPUT_NAME=puresql.${{ matrix.destination.name }}.tar.gz
28+ - name : Upload the binary
29+ uses : actions/upload-artifact@v4
30+ with :
31+ name : puresql.${{ matrix.destination.name }}.tar.gz
32+ path : puresql.${{ matrix.destination.name }}.tar.gz
33+
34+ make-artifact-bundle :
35+ needs : [build]
36+ runs-on : ubuntu-latest
37+ outputs :
38+ checksum : ${{ steps.checksum.outputs.checksum }}
39+ steps :
40+ - uses : actions/checkout@v4
41+ - name : Download all artifacts
42+ uses : actions/download-artifact@v4
43+ with :
44+ merge-multiple : true
45+ - run : bundle/make_artifactbundle.sh ${{ github.event.release.tag_name || github.ref_name }}
46+ - name : Upload artifact bundle
47+ uses : actions/upload-artifact@v4
48+ with :
49+ name : puresql.artifactbundle.zip
50+ path : puresql.artifactbundle.zip
51+ - name : Compute checksum
52+ id : checksum
53+ run : echo "checksum=$(swift package compute-checksum puresql.artifactbundle.zip)" >> "$GITHUB_OUTPUT"
54+
55+ deploy-binary :
56+ if : ${{ github.event_name == 'release' }}
57+ needs : [make-artifact-bundle]
58+ runs-on : ubuntu-latest
59+ steps :
60+ - uses : actions/download-artifact@v4
61+ with :
62+ merge-multiple : true
63+ - name : Deploy the binary
64+ uses : softprops/action-gh-release@v2
65+ with :
66+ files : |
67+ puresql.ubuntu-x86_64.tar.gz
68+ puresql.ubuntu-aarch64.tar.gz
69+ puresql.macos-universal.tar.gz
70+ puresql.artifactbundle.zip
0 commit comments