Skip to content

Commit

Permalink
Merge pull request #80 from tayloraswift/device-support
Browse files Browse the repository at this point in the history
add support for iDevices, and add CI workflows
  • Loading branch information
tayloraswift authored Nov 15, 2024
2 parents 467f8b6 + 88a7dec commit e677ba0
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
- name: Install Swift
uses: tayloraswift/swift-install-action@master
with:
swift-prefix: "swift-6.0.1-release/ubuntu2404/swift-6.0.1-RELEASE"
swift-id: "swift-6.0.1-RELEASE-ubuntu24.04"
swift-prefix: "swift-6.0.2-release/ubuntu2404/swift-6.0.2-RELEASE"
swift-id: "swift-6.0.2-RELEASE-ubuntu24.04"

- name: Install Unidoc
uses: tayloraswift/swift-unidoc-action@master
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
linux:
runs-on: ubuntu-24.04
name: Ubuntu 24.04

steps:
- name: Install Swift
uses: tayloraswift/swift-install-action@master
with:
swift-prefix: "swift-6.0.2-release/ubuntu2404/swift-6.0.2-RELEASE"
swift-id: "swift-6.0.2-RELEASE-ubuntu24.04"

- name: Checkout repository
uses: actions/checkout@v3

- name: Run tests
run: Scripts/TestAll

macos:
runs-on: macos-15
name: macOS

steps:
- name: Install Swift
uses: tayloraswift/swift-install-action@master
with:
swift-prefix: "swift-6.0.2-release/xcode/swift-6.0.2-RELEASE"
swift-id: "swift-6.0.2-RELEASE"

- name: Checkout repository
uses: actions/checkout@v3

- name: Run tests
run: Scripts/TestAll
14 changes: 14 additions & 0 deletions .github/workflows/iOS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: iOS

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
uses: tayloraswift/swift-device-action/.github/workflows/build.yml@master
with:
xcode-scheme: 'PNG'
destination: ${{ github.workflow }}
89 changes: 0 additions & 89 deletions .github/workflows/test.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/tvOS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: tvOS

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
uses: tayloraswift/swift-device-action/.github/workflows/build.yml@master
with:
xcode-scheme: 'PNG'
destination: ${{ github.workflow }}
14 changes: 14 additions & 0 deletions .github/workflows/visionOS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: visionOS

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
uses: tayloraswift/swift-device-action/.github/workflows/build.yml@master
with:
xcode-scheme: 'PNG'
destination: ${{ github.workflow }}
14 changes: 14 additions & 0 deletions .github/workflows/watchOS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: watchOS

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
uses: tayloraswift/swift-device-action/.github/workflows/build.yml@master
with:
xcode-scheme: 'PNG'
destination: ${{ github.workflow }}
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<div align="center">

***`png`***<br>`4.4`
***`png`***

[![ci status](https://github.com/tayloraswift/swift-png/actions/workflows/test.yml/badge.svg)](https://github.com/tayloraswift/swift-png/actions/workflows/test.yml)
[![ci status](https://github.com/tayloraswift/swift-png/actions/workflows/docs.yml/badge.svg)](https://github.com/tayloraswift/swift-png/actions/workflows/docs.yml)


[![swift package index versions](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftayloraswift%2Fswift-png%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/tayloraswift/swift-png)
[![swift package index platforms](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftayloraswift%2Fswift-png%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/tayloraswift/swift-png)
[![Tests](https://github.com/tayloraswift/swift-png/actions/workflows/Tests.yml/badge.svg)](https://github.com/tayloraswift/swift-png/actions/workflows/Tests.yml)
[![Documentation](https://github.com/tayloraswift/swift-png/actions/workflows/Documentation.yml/badge.svg)](https://github.com/tayloraswift/swift-png/actions/workflows/Documentation.yml)

</div>

Expand All @@ -19,6 +15,24 @@ Swift *PNG* is [available](LICENSE) under the [Apache 2.0 license](https://www.a

Swift *PNG*’s [documentation](https://swiftinit.org/docs/swift-png/png) is available on Swiftinit!


## Requirements

The swift-png library requires Swift 5.10 or later.

| Platform | Status |
| -------- | ------ |
| 🐧 Linux | [![Tests](https://github.com/tayloraswift/swift-png/actions/workflows/Tests.yml/badge.svg)](https://github.com/tayloraswift/swift-png/actions/workflows/Tests.yml) |
| 🍏 Darwin | [![Tests](https://github.com/tayloraswift/swift-png/actions/workflows/Tests.yml/badge.svg)](https://github.com/tayloraswift/swift-png/actions/workflows/Tests.yml) |
| 🍏 Darwin (iOS) | [![iOS](https://github.com/tayloraswift/swift-png/actions/workflows/iOS.yml/badge.svg)](https://github.com/tayloraswift/swift-png/actions/workflows/iOS.yml) |
| 🍏 Darwin (tvOS) | [![tvOS](https://github.com/tayloraswift/swift-png/actions/workflows/tvOS.yml/badge.svg)](https://github.com/tayloraswift/swift-png/actions/workflows/tvOS.yml) |
| 🍏 Darwin (visionOS) | [![visionOS](https://github.com/tayloraswift/swift-png/actions/workflows/visionOS.yml/badge.svg)](https://github.com/tayloraswift/swift-png/actions/workflows/visionOS.yml) |
| 🍏 Darwin (watchOS) | [![watchOS](https://github.com/tayloraswift/swift-png/actions/workflows/watchOS.yml/badge.svg)](https://github.com/tayloraswift/swift-png/actions/workflows/watchOS.yml) |


[Check deployment minimums](https://swiftinit.org/docs/swift-png#ss:platform-requirements)


## Getting started

To use *Swift PNG* in a project, add this descriptor to the `dependencies` list in your `Package.swift` file:
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions Sources/PNG/System.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#if os(macOS) || os(iOS)
#if canImport(Darwin)
import Darwin
#elseif canImport(Glibc)
import Glibc
Expand All @@ -15,7 +15,7 @@
#warning("unsupported or untested platform (please open an issue at https://github.com/tayloraswift/swift-png/issues)")
#endif

#if os(macOS) || os(iOS) || os(Linux) || os(Windows)
#if canImport(Darwin) || canImport(Glibc) || canImport(Musl) || os(Windows)

/// A namespace for platform-dependent functionality.
///
Expand Down

0 comments on commit e677ba0

Please sign in to comment.