Skip to content

Commit e27e6c3

Browse files
authored
Merge pull request #19 from xtremekforever/main
Add Swift 6.1 support
2 parents 6d34b01 + 3245700 commit e27e6c3

File tree

16 files changed

+144
-184
lines changed

16 files changed

+144
-184
lines changed

.github/actions/build-for-distribution/action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ runs:
2727
name: Build Swift + SDK using Sysroot
2828
with:
2929
swift-tag: ${{ inputs.swift-tag }}
30-
swift-workspace-cache: ${{ inputs.swift-workspace-cache }}
31-
sysroot-id: sysroot-${{ inputs.distribution }}
3230
sysroot-name: sysroot-${{ inputs.distribution }}-armv7
3331
distribution: ${{ inputs.distribution }}
3432
builder-tag: ${{ inputs.builder-tag }}

.github/actions/build-with-sysroot/action.yml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ inputs:
44
swift-tag:
55
description: The Swift tag version that is being built
66
required: true
7-
swift-workspace-cache:
8-
description: The name of the Swift workspace directory to restore
9-
required: true
10-
sysroot-id:
11-
description: The sysroot ID to use when caching and publishing
12-
required: true
137
sysroot-name:
148
description: The name of the sysroot to use to build Swift
159
required: true
@@ -22,28 +16,14 @@ inputs:
2216
runs:
2317
using: "composite"
2418
steps:
25-
- name: Restore Sysroot
26-
id: restore-sysroot
27-
uses: actions/cache/restore@v4
28-
with:
29-
key: ${{ inputs.sysroot-id }}
30-
path: ${{ inputs.sysroot-name }}
31-
- if: ${{ steps.restore-sysroot.outputs.cache-hit != 'true' }}
32-
name: Build
19+
- name: Build
3320
shell: bash
3421
env:
3522
DISTRIBUTION: ${{ inputs.distribution }}
36-
run: ./build-sysroot.sh `echo ${DISTRIBUTION/-/:}` ${{ inputs.sysroot-name }}
23+
run: ./build-sysroot.sh $(echo ${DISTRIBUTION/-/:}) ${{ inputs.sysroot-name }}
3724
- name: Compress
3825
shell: bash
3926
run: tar -czf ${{ inputs.sysroot-name }}.tar.gz ${{ inputs.sysroot-name }}
40-
- name: Cache Sysroot
41-
id: cache-sysroot
42-
if: steps.restore-sysroot.outputs.cache-hit != 'true'
43-
uses: actions/cache/save@v4
44-
with:
45-
key: ${{ inputs.sysroot-id }}
46-
path: ${{ inputs.sysroot-name }}
4727
- name: Build Swift
4828
shell: bash
4929
run: |
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build Swift Latest
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
DISTRIBUTION: debian-bookworm
11+
12+
jobs:
13+
build-latest:
14+
strategy:
15+
matrix:
16+
version: ["6.0.3"]
17+
env:
18+
SWIFT_VERSION: ${{ matrix.version }}
19+
SWIFT_TAG: swift-${{ matrix.version }}-RELEASE
20+
name: Build Swift
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: ./.github/actions/checkout-swift
25+
name: Fetch Swift Sources
26+
with:
27+
swift-tag: ${{ env.SWIFT_TAG }}
28+
swift-workspace-cache: swift-workspace
29+
- name: Generate Builder Container
30+
shell: bash
31+
run: |
32+
source ./swift-builder/swift-builder-common
33+
./swift-builder/build-container.sh
34+
- uses: ./.github/actions/build-for-distribution
35+
name: Build & Publish Swift
36+
with:
37+
swift-tag: ${{ env.SWIFT_TAG }}
38+
distribution: ${{ env.DISTRIBUTION }}
39+
builder-tag: ${{ env.SWIFT_VERSION }}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build Swift Nightly
2+
3+
on:
4+
pull_request:
5+
schedule:
6+
- cron: '0 9 * * *'
7+
8+
env:
9+
DISTRIBUTION: debian-bookworm
10+
11+
jobs:
12+
nightly:
13+
strategy:
14+
matrix:
15+
branch: ["swift-6.1-branch", "development"]
16+
env:
17+
SWIFT_TAG:
18+
SWIFT_BRANCH: ${{ matrix.branch }}
19+
SWIFT_PLATFORM: ubuntu2204
20+
SWIFT_VERSION: ${{ matrix.branch }}
21+
SWIFT_WORKSPACE_CACHE: swift-workspace
22+
name: Build Swift Nigtly
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Get Latest Nightly Version
27+
shell: bash
28+
run: |
29+
export $(curl https://download.swift.org/${{ env.SWIFT_BRANCH }}/${{ env.SWIFT_PLATFORM }}/latest-build.yml | grep 'dir:' | sed 's/:[^:\/\/]/=/g')
30+
echo "Latest Tag on ${{ env.SWIFT_BRANCH }} Branch: $dir"
31+
echo "SWIFT_TAG=$(echo $dir)" >> $GITHUB_ENV
32+
- uses: ./.github/actions/checkout-swift
33+
name: Fetch Swift Sources
34+
with:
35+
swift-tag: ${{ env.SWIFT_TAG }}
36+
swift-workspace-cache: ${{ env.SWIFT_WORKSPACE_CACHE }}
37+
- name: Build Swift Nightly Container
38+
shell: bash
39+
run: |
40+
source ./swift-builder/swift-builder-common
41+
./swift-builder/build-container.sh
42+
- uses: ./.github/actions/build-for-distribution
43+
name: Build & Publish Swift
44+
with:
45+
swift-tag: ${{ env.SWIFT_TAG }}
46+
distribution: ${{ env.DISTRIBUTION }}
47+
builder-tag: ${{ env.SWIFT_VERSION }}

.github/workflows/build-swift-release.yml

Lines changed: 31 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ on:
55
types: [published]
66

77
env:
8+
SWIFT_VERSION: ${{ github.event.release.tag_name }}
89
SWIFT_TAG: swift-${{ github.event.release.tag_name }}-RELEASE
9-
SWIFT_WORKSPACE_CACHE: swift-${{ github.event.release.tag_name }}-workspace
10-
SWIFT_BUILDER_TAG: ${{ github.event.release.tag_name }}-gh-runner
10+
SWIFT_WORKSPACE_CACHE: swift-workspace
1111

1212
jobs:
1313
fetch-sources:
@@ -16,77 +16,45 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818
- uses: ./.github/actions/checkout-swift
19-
name: "Restore or Checkout: ${{ env.SWIFT_TAG }}"
19+
name: "Restore or Checkout ${{ env.SWIFT_VERSION }}"
2020
with:
2121
swift-tag: ${{ env.SWIFT_TAG }}
2222
swift-workspace-cache: ${{ env.SWIFT_WORKSPACE_CACHE }}
2323

24-
debian-bullseye:
25-
name: Build for Debian Bullseye
24+
build-for-distribution:
25+
strategy:
26+
matrix:
27+
distribution: [
28+
"debian-bullseye",
29+
"debian-bookworm",
30+
"ubuntu-focal",
31+
"ubuntu-jammy",
32+
"ubuntu-noble"
33+
]
34+
name: Build Swift
2635
runs-on: ubuntu-latest
2736
needs: [fetch-sources]
2837
steps:
2938
- uses: actions/checkout@v4
39+
- name: Generate Builder Container
40+
shell: bash
41+
run: |
42+
source ./swift-builder/swift-builder-common
43+
./swift-builder/build-container.sh
3044
- uses: ./.github/actions/build-for-distribution
31-
name: "Build & Publish Swift: ${{ env.SWIFT_TAG }}"
45+
name: "Build & Publish Swift ${{ env.SWIFT_VERSION }}"
3246
with:
3347
swift-tag: ${{ env.SWIFT_TAG }}
3448
swift-workspace-cache: ${{ env.SWIFT_WORKSPACE_CACHE }}
35-
distribution: ${{ github.job }}
36-
builder-tag: ${{ env.SWIFT_BUILDER_TAG }}
37-
38-
debian-bookworm:
39-
name: Build for Debian Bookworm
40-
runs-on: ubuntu-latest
41-
needs: [fetch-sources]
42-
steps:
43-
- uses: actions/checkout@v4
44-
- uses: ./.github/actions/build-for-distribution
45-
name: "Build & Publish Swift: ${{ env.SWIFT_TAG }}"
46-
with:
47-
swift-tag: ${{ env.SWIFT_TAG }}
48-
swift-workspace-cache: ${{ env.SWIFT_WORKSPACE_CACHE }}
49-
distribution: ${{ github.job }}
50-
builder-tag: ${{ env.SWIFT_BUILDER_TAG }}
51-
52-
ubuntu-focal:
53-
name: Build for Ubuntu Focal
54-
runs-on: ubuntu-latest
55-
needs: [fetch-sources]
56-
steps:
57-
- uses: actions/checkout@v4
58-
- uses: ./.github/actions/build-for-distribution
59-
name: "Build & Publish Swift: ${{ env.SWIFT_TAG }}"
49+
distribution: ${{ matrix.distribution }}
50+
builder-tag: ${{ env.SWIFT_VERSION }}
51+
- name: Update Release ${{ env.SWIFT_VERSION }}
52+
uses: ncipollo/release-action@v1
6053
with:
61-
swift-tag: ${{ env.SWIFT_TAG }}
62-
swift-workspace-cache: ${{ env.SWIFT_WORKSPACE_CACHE }}
63-
distribution: ${{ github.job }}
64-
builder-tag: ${{ env.SWIFT_BUILDER_TAG }}
65-
66-
ubuntu-jammy:
67-
name: Build for Ubuntu Jammy
68-
runs-on: ubuntu-latest
69-
needs: [fetch-sources]
70-
steps:
71-
- uses: actions/checkout@v4
72-
- uses: ./.github/actions/build-for-distribution
73-
name: "Build & Publish Swift: ${{ env.SWIFT_TAG }}"
74-
with:
75-
swift-tag: ${{ env.SWIFT_TAG }}
76-
swift-workspace-cache: ${{ env.SWIFT_WORKSPACE_CACHE }}
77-
distribution: ${{ github.job }}
78-
builder-tag: ${{ env.SWIFT_BUILDER_TAG }}
79-
80-
ubuntu-noble:
81-
name: Build for Ubuntu Noble
82-
runs-on: ubuntu-latest
83-
needs: [fetch-sources]
84-
steps:
85-
- uses: actions/checkout@v4
86-
- uses: ./.github/actions/build-for-distribution
87-
name: "Build & Publish Swift: ${{ env.SWIFT_TAG }}"
88-
with:
89-
swift-tag: ${{ env.SWIFT_TAG }}
90-
swift-workspace-cache: ${{ env.SWIFT_WORKSPACE_CACHE }}
91-
distribution: ${{ github.job }}
92-
builder-tag: ${{ env.SWIFT_BUILDER_TAG }}
54+
allowUpdates: true
55+
name: Swift ${{ env.SWIFT_VERSION }} for armv7
56+
tag: ${{ env.SWIFT_VERSION }}
57+
commit: ${{ github.sha }}
58+
artifactErrorsFailBuild: true
59+
artifacts: "*.tar.gz"
60+
body: "See the [README](https://github.com/xtremekforever/swift-armv7#continuous-integration) for more information on build artifacts."

.github/workflows/build-swift-versions.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ After building the armv7 runtime using the `build.sh` script, you can generate a
7373
using the `build-linux-cross-sdk.sh` script. You must provide the swift tag and distribution name:
7474

7575
```bash
76-
./build-linux-cross-sdk.sh swift-5.10.1-RELEASE ubuntu-noble
76+
./build-linux-cross-sdk.sh swift-6.0.3-RELEASE ubuntu-noble
7777
```
7878

7979
By default, the SDK will be generated to be installed at a path of /opt/$SWIFT_TAG-$DISTRIBUTION-armv7, but this can be customized by providing a different install prefix to the script:
8080

8181
```bash
8282
export SDK_INSTALL_PREFIX=/home/myuser/swift-sdks
83-
./build-linux-cross-sdk.sh swift-5.10.1-RELEASE ubuntu-noble
83+
./build-linux-cross-sdk.sh swift-6.0.3-RELEASE ubuntu-noble
8484
```
8585

8686
## Continuous Integration & Releases
@@ -97,11 +97,11 @@ To use the SDK that is generated by the CI or published to the [Releases](https:
9797
extract it to /opt:
9898

9999
```bash
100-
sudo tar -xf swift-5.10.1-RELEASE-debian-bookworm-armv7-sdk.tar.gz -C /opt
100+
sudo tar -xf swift-6.0.3-RELEASE-debian-bookworm-armv7-sdk.tar.gz -C /opt
101101
```
102102

103103
Then, from a Swift package, use the `--destination` paramter to cross-compile it for the target:
104104

105105
```bash
106-
swift build --destination /opt/swift-5.10.1-RELEASE-debian-bookworm-armv7/debian-bookworm.json
106+
swift build --destination /opt/swift-6.0.3-RELEASE-debian-bookworm-armv7/debian-bookworm.json
107107
```

build-foundation.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ LIBS="-latomic" cmake -S $FOUNDATION_SRCDIR -B $FOUNDATION_BUILDDIR -G Ninja \
3737
-DCMAKE_Swift_FLAGS_DEBUG="" \
3838
-DCMAKE_Swift_FLAGS_RELEASE="" \
3939
-DCMAKE_Swift_FLAGS_RELWITHDEBINFO="" \
40+
-DSwiftFoundation_MACRO="${SWIFT_NATIVE_PATH}../lib/host/plugins/libFoundationMacros.so" \
4041
-D_SwiftFoundation_SourceDIR="$SRC_ROOT/downloads/swift-foundation" \
4142
-D_SwiftFoundationICU_SourceDIR="$SRC_ROOT/downloads/swift-foundation-icu" \
4243
-D_SwiftCollections_SourceDIR="$SRC_ROOT/downloads/swift-collections" \

build-in-container.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ source ./swift-builder/swift-builder-common
1010
echo "Building Swift ${SWIFT_TAG} using ${DOCKER_TAG}..."
1111
docker run \
1212
--rm -ti \
13-
--user ${BUILD_USER}:${BUILD_USER} \
13+
--user ${USER}:${USER} \
1414
--volume $(pwd):/src \
1515
--workdir /src \
1616
-e SWIFT_VERSION=${SWIFT_TAG} \
17-
${DOCKER_REPO}swift-builder:${SWIFT_VERSION} \
17+
-e STAGING_DIR=${STAGING_DIR} \
18+
-e INSTALL_TAR=${INSTALL_TAG} \
19+
${DOCKER_TAG} \
1820
./build.sh

build-swift-stdlib.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ LIBS="-latomic" cmake -S $SWIFT_SRCDIR -B $SWIFT_BUILDDIR -G Ninja \
5454
-DSWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES=ON \
5555
-DSWIFT_ENABLE_EXPERIMENTAL_OBSERVATION=ON \
5656
-DSWIFT_ENABLE_SYNCHRONIZATION=ON \
57+
-DSWIFT_SHOULD_BUILD_EMBEDDED_STDLIB=OFF \
5758
-DSWIFT_INCLUDE_TESTS=OFF \
5859
-DSWIFT_INCLUDE_TEST_BINARIES=OFF \
5960
-DSWIFT_BUILD_TEST_SUPPORT_MODULES=OFF \

0 commit comments

Comments
 (0)