Skip to content

Commit

Permalink
Add support for building release for Raspi OS versions, armv6 and armv7
Browse files Browse the repository at this point in the history
  • Loading branch information
xtremekforever committed Dec 27, 2024
1 parent 207bbeb commit a44ddd5
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-swift-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ jobs:
name: Build & Publish Swift
with:
swift-tag: ${{ env.SWIFT_TAG }}
swift-target-arch: armv7
distribution: ${{ env.DISTRIBUTION }}
builder-tag: ${{ env.SWIFT_VERSION }}
44 changes: 42 additions & 2 deletions .github/workflows/build-swift-release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: Build Swift Release

on:
push:
branches: [ "feature/**" ]
release:
types: [published]

env:
SWIFT_VERSION: ${{ github.event.release.tag_name }}
SWIFT_TAG: swift-${{ github.event.release.tag_name }}-RELEASE
SWIFT_VERSION: 6.0.3
SWIFT_TAG: swift-6.0.3-RELEASE
SWIFT_WORKSPACE_CACHE: swift-workspace

jobs:
Expand Down Expand Up @@ -46,6 +48,7 @@ jobs:
with:
swift-tag: ${{ env.SWIFT_TAG }}
swift-workspace-cache: ${{ env.SWIFT_WORKSPACE_CACHE }}
swift-target-arch: armv7
distribution: ${{ matrix.distribution }}
builder-tag: ${{ env.SWIFT_VERSION }}
- name: Update Release ${{ env.SWIFT_VERSION }}
Expand All @@ -58,3 +61,40 @@ jobs:
artifactErrorsFailBuild: true
artifacts: "*.tar.gz"
body: "See the [README](https://github.com/xtremekforever/swift-armv7#continuous-integration) for more information on build artifacts."

build-for-raspios:
strategy:
matrix:
distribution: [
"raspios-bullseye",
"raspios-bookworm"
]
swift-target-arch: ["armv6", "armv7"]
name: Build for RaspiOS
runs-on: ubuntu-latest
needs: [fetch-sources]
steps:
- uses: actions/checkout@v4
- name: Generate Builder Container
shell: bash
run: |
source ./swift-builder/swift-builder-common
./swift-builder/build-container.sh
- uses: ./.github/actions/build-for-distribution
name: "Build & Publish Swift ${{ env.SWIFT_VERSION }}"
with:
swift-tag: ${{ env.SWIFT_TAG }}
swift-workspace-cache: ${{ env.SWIFT_WORKSPACE_CACHE }}
swift-target-arch: ${{ matrix.swift-target-arch }}
distribution: ${{ matrix.distribution }}
builder-tag: ${{ env.SWIFT_VERSION }}
- name: Update Release ${{ env.SWIFT_VERSION }}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: Swift ${{ env.SWIFT_VERSION }} for armv6/armv7
tag: ${{ env.SWIFT_VERSION }}
commit: ${{ github.sha }}
artifactErrorsFailBuild: true
artifacts: "*.tar.gz"
body: "See the [README](https://github.com/xtremekforever/swift-armv7#continuous-integration) for more information on build artifacts."
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Some main goals:
- Provide SDKs that can be downloaded and used to cross-compile user applications and libraries to armv7.
- Maintain a CI that can build snapshots/nightly versions of Swift to find and fix issues.

NOTE: Building for armv6 is also now supported, although it is limited to working with the `raspios`
distribution since that is the only version of Debian that supports the ARMv6 architecture. However,
this makes this project also compatible with older Raspberry Pi models such as the RPI 1, Zero, and so on.

## Compilation

There are various options for compiling Swift for armv7 with these scripts.
Expand Down

0 comments on commit a44ddd5

Please sign in to comment.