From a44ddd54847ca5fb52e37d520eae5d25923571cb Mon Sep 17 00:00:00 2001 From: "Jesse L. Zamora" Date: Fri, 27 Dec 2024 15:59:01 -0500 Subject: [PATCH] Add support for building release for Raspi OS versions, armv6 and armv7 --- .github/workflows/build-swift-nightly.yml | 1 + .github/workflows/build-swift-release.yml | 44 +++++++++++++++++++++-- README.md | 4 +++ 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-swift-nightly.yml b/.github/workflows/build-swift-nightly.yml index 00ebb5a..f000fb0 100644 --- a/.github/workflows/build-swift-nightly.yml +++ b/.github/workflows/build-swift-nightly.yml @@ -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 }} diff --git a/.github/workflows/build-swift-release.yml b/.github/workflows/build-swift-release.yml index bc791ce..2a036ea 100644 --- a/.github/workflows/build-swift-release.yml +++ b/.github/workflows/build-swift-release.yml @@ -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: @@ -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 }} @@ -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." diff --git a/README.md b/README.md index ee66d96..4eff208 100644 --- a/README.md +++ b/README.md @@ -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.