TIL about withLock existing in all kinds of locks. It’s strange I haven’t encountered it before. It’s declared in NSLocking protocol.

private let lock = NSRecursiveLock()
lock.withLock {
    state[keyPath: keyPath]

Set up workflow to build and test swift-geometrize on Ubuntu. Side effect of this - install-swift.sh script for installing Swift 5.9 on Ubuntu 22.04. Currently workflow installs dependencies with apt-get everytime it runs. That’s waist of resources. It could be improved with caching. It looks a bit complicated. May be later I will return to it.

I see this GitHub Actions’ Workflow for Swift Package which builds Swift package on both Ubuntu 22.04 and macOS and uses caching for dependencies. A bit more complex Action Swift Setup of the same author in Actions marketplace. May be I should just use it.

This is nice Action Swift Release for releasing Swift package.

TIL how strange YAML syntax is that it needs dedicated website to explain how to make multi-line string in YAML. I needed multi-line string for incorporating Swift install commands into GitHub workflow.