Skip to content

Commit 0d70712

Browse files
Start working on release CI to build Swift SDKs for all arches and supported distributions
1 parent 6663bfc commit 0d70712

File tree

2 files changed

+152
-1
lines changed

2 files changed

+152
-1
lines changed

.github/workflows/develop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The purpose of this CI is to build and test Linux Cross SDKs during development.
22
# Only a single version of the SDK will be built for each architecture and tested.
33
name: Develop Swift Linux Cross SDKs
4-
run-name: Build Cross SDKs for ${{ inputs.swift-version }} ${{ inputs.distribution }}
4+
run-name: Build Swift SDKs for ${{ inputs.swift-version }} ${{ inputs.distribution }}
55

66
on:
77
workflow_dispatch:

.github/workflows/release.yml

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# The purpose of this CI is to build and test Swift SDKs for a given Swift version.
2+
name: Release Swift Linux Cross SDKs
3+
run-name: Build Swift SDKs for ${{ inputs.swift-version }}, all supported distributions
4+
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
swift-version:
9+
description: 'Swift Version'
10+
required: true
11+
default: '6.2.1'
12+
type: string
13+
14+
env:
15+
SWIFT_VERSION: ${{ inputs.swift-version || '6.1.2' }}
16+
SDK_GENERATOR_DIR: swift-sdk-generator
17+
TEST_PROJECT: test-project
18+
19+
jobs:
20+
sdk-generator-amd64:
21+
name: Swift SDK Generator (amd64)
22+
runs-on: ubuntu-24.04
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Swift Version
26+
shell: bash
27+
run: swift --version
28+
- name: Common Dependencies Cache
29+
uses: actions/cache@v4
30+
with:
31+
key: common-dependencies-amd64
32+
path: |
33+
${{ env.SDK_GENERATOR_DIR }}
34+
${{ env.TEST_PROJECT }}/.build
35+
- name: Build SDK Generator
36+
shell: bash
37+
run: ./build-generator.sh
38+
- name: Resolve Test Dependencies
39+
shell: bash
40+
run: swift package resolve --package-path ${{ env.TEST_PROJECT }}
41+
sdk-generator-arm64:
42+
name: Swift SDK Generator (arm64)
43+
runs-on: ubuntu-24.04-arm
44+
steps:
45+
- uses: actions/checkout@v4
46+
- name: Swift Version
47+
shell: bash
48+
run: swift --version
49+
- name: Common Dependencies Cache
50+
uses: actions/cache@v4
51+
with:
52+
key: common-dependencies-arm64
53+
path: |
54+
${{ env.SDK_GENERATOR_DIR }}
55+
${{ env.TEST_PROJECT }}/.build
56+
- name: Build SDK Generator
57+
shell: bash
58+
run: ./build-generator.sh
59+
- name: Resolve Test Dependencies
60+
shell: bash
61+
run: swift package resolve --package-path ${{ env.TEST_PROJECT }}
62+
63+
build-test-x86_64:
64+
strategy:
65+
fail-fast: false
66+
matrix:
67+
distribution:
68+
- ubuntu-focal
69+
- ubuntu-jammy
70+
- ubuntu-noble
71+
- debian-bullseye
72+
- debian-bookworm
73+
- rhel-ubi9
74+
- amazonlinux2
75+
name: Build & Test SDK (x86_64)
76+
runs-on: ubuntu-24.04
77+
permissions:
78+
contents: write
79+
needs: [sdk-generator-amd64]
80+
steps:
81+
- uses: actions/checkout@v4
82+
- name: Restore Swift SDK Generator
83+
uses: actions/cache/restore@v4
84+
with:
85+
key: common-dependencies-amd64
86+
path: |
87+
${{ env.SDK_GENERATOR_DIR }}
88+
${{ env.TEST_PROJECT }}/.build
89+
fail-on-cache-miss: true
90+
- uses: ./.github/actions/build-and-test-sdk
91+
name: Build, Test, Publish ${{ env.SWIFT_VERSION }} for ${{ matrix.distribution }}
92+
with:
93+
swift-version: ${{ env.SWIFT_VERSION }}
94+
distribution: ${{ matrix.distribution }}
95+
target-arch: x86_64
96+
- name: Update Release ${{ env.SWIFT_VERSION }}
97+
uses: ncipollo/release-action@v1
98+
with:
99+
allowUpdates: true
100+
name: Swift ${{ env.SWIFT_VERSION }} SDKs
101+
tag: ${{ env.SWIFT_VERSION }}
102+
commit: ${{ github.sha }}
103+
artifactErrorsFailBuild: false
104+
artifacts: "artifacts/*.tar.gz"
105+
body: |
106+
Swift ${{ env.SWIFT_VERSION }} SDKs pre-built for various supported Linux distributions.
107+
108+
build-test-aarch64:
109+
strategy:
110+
fail-fast: false
111+
matrix:
112+
distribution:
113+
- ubuntu-focal
114+
- ubuntu-jammy
115+
- ubuntu-noble
116+
- debian-bullseye
117+
- debian-bookworm
118+
- rhel-ubi9
119+
- amazonlinux2
120+
name: Build & Test SDK (aarch64)
121+
runs-on: ubuntu-24.04-arm
122+
permissions:
123+
contents: write
124+
needs: [sdk-generator-arm64]
125+
steps:
126+
- uses: actions/checkout@v4
127+
- name: Restore Swift SDK Generator
128+
uses: actions/cache/restore@v4
129+
with:
130+
key: common-dependencies-arm64
131+
path: |
132+
${{ env.SDK_GENERATOR_DIR }}
133+
${{ env.TEST_PROJECT }}/.build
134+
fail-on-cache-miss: true
135+
- uses: ./.github/actions/build-and-test-sdk
136+
name: Build, Test, Publish ${{ env.SWIFT_VERSION }} for ${{ matrix.distribution }}
137+
with:
138+
swift-version: ${{ env.SWIFT_VERSION }}
139+
distribution: ${{ matrix.distribution }}
140+
target-arch: aarch64
141+
- name: Update Release ${{ env.SWIFT_VERSION }}
142+
uses: ncipollo/release-action@v1
143+
with:
144+
allowUpdates: true
145+
name: Swift ${{ env.SWIFT_VERSION }} SDKs
146+
tag: ${{ env.SWIFT_VERSION }}
147+
commit: ${{ github.sha }}
148+
artifactErrorsFailBuild: false
149+
artifacts: "artifacts/*.tar.gz"
150+
body: |
151+
Swift ${{ env.SWIFT_VERSION }} SDKs pre-built for various supported Linux distributions.

0 commit comments

Comments
 (0)