Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 8 additions & 46 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ jobs:
action: ${{ matrix.action }}

configurations:
runs-on: macos-12
runs-on: macos-13
needs: [verify-dist]
strategy:
matrix:
Expand All @@ -190,7 +190,8 @@ jobs:
with:
configuration: ${{ matrix.configuration }}
working-directory: fixtures/${{ matrix.configuration }}
warnings-as-errors: true
# warnings-as-errors: true
# ^^ works via generation, generation no longer works
action: test
upload-logs: always # so we can test this feature

Expand Down Expand Up @@ -219,16 +220,10 @@ jobs:
strategy:
matrix:
x:
- swift: ~5.5
os: macos-12
- swift: ~5.6
os: macos-12
- swift: ~5.7
os: macos-13
- swift: ~5.8
os: macos-13
- swift: ~5.9
os: macos-14
- swift: ~5.10
os: macos-14
steps:
Expand All @@ -244,7 +239,7 @@ jobs:

xcode:
name: ${{ matrix.platform }} (${{ matrix.action }}, ${{ matrix.xcode }}${{ matrix.codecov && ', cc' || ''}}${{ matrix.job-name-sufix }})
runs-on: ${{ matrix.os || 'macos-12' }}
runs-on: ${{ matrix.os || 'macos-latest' }}
needs: [verify-dist]
continue-on-error: true
strategy:
Expand All @@ -255,8 +250,8 @@ jobs:
- macOS
- watchOS
xcode:
- ^13
- ^14
- ^15
codecov:
- false
action:
Expand All @@ -267,10 +262,8 @@ jobs:
- job-name-sufix: ', platform-version ^16'
platform: iOS
platform-version: ^16
os: macos-13
xcode: ^14
os: macos-14
- platform: mac-catalyst
xcode: ^13
codecov: false
action: test
warnings-as-errors: false
Expand All @@ -294,40 +287,9 @@ jobs:
- run: |
xcode-select --print-path

# lol we didn't comment on how this was different to the above and now I'm not sure
more-xcode:
name: ${{ matrix.platform }} (${{ matrix.action }}, ${{ matrix.xcode }}${{ matrix.codecov && ', cc' || ''}}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: [verify-dist]
strategy:
matrix:
os:
- macos-12
platform:
- watchOS
xcode:
- ^13
codecov:
- false
action:
- build
- test
warnings-as-errors:
- false
steps:
- uses: actions/checkout@v4
- uses: ./
with:
platform: ${{ matrix.platform }}
xcode: ${{ matrix.xcode }}
working-directory: fixtures/${{ matrix.platform }}
code-coverage: ${{ matrix.codecov }}
action: ${{ matrix.action }}
warnings-as-errors: ${{ matrix.warnings-as-errors }}

verify-codecov:
name: ${{ matrix.platform }} (${{ matrix.action }}${{ matrix.codecov && ', cc' || ''}}${{ matrix.warnings-as-errors && ', warnings-as-errors' || ''}})
runs-on: macos-12
runs-on: macos-13
needs: [verify-dist]
strategy:
matrix:
Expand All @@ -340,7 +302,7 @@ jobs:
- build
- test
warnings-as-errors:
- true
# - true
- false
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

18 changes: 12 additions & 6 deletions src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ import semver, { Range } from 'semver'
import type { SemVer } from 'semver'

async function mdls(path: string): Promise<SemVer | undefined> {
const v = await exec('mdls', ['-raw', '-name', 'kMDItemVersion', path])
if (core.getInput('verbosity') == 'verbose') {
// in verbose mode all commands and outputs are printed
// and mdls in `raw` mode does not terminate its lines
process.stdout.write('\n')
try {
const v = await exec('mdls', ['-raw', '-name', 'kMDItemVersion', path])
if (core.getInput('verbosity') == 'verbose') {
// in verbose mode all commands and outputs are printed
// and mdls in `raw` mode does not terminate its lines
process.stdout.write('\n')
}
return semver.coerce(v) ?? undefined
} catch (e) {
const match = path.match(/Xcode_(.*)\.app/)
if (!match?.[1]) throw e
return semver.coerce(match[1]) ?? undefined
}
return semver.coerce(v) ?? undefined
}

async function xcodes(): Promise<[string, SemVer][]> {
Expand Down
Loading