Files
SwiftFormat/.github/workflows/linux_build.yml
T
Yuta Saito 52c2135353 Remove runtime stdlib dependency from pre-built binary targeting Linux
Currently, the pre-built binary targeting Linux links Swift stdlib and
core libraries dynamically. Unlike darwin platforms, Swift does not
guarantee ABI stability on Linux, so the pre-built binary must be run
with exactly the same version of Swift stdlib and core libraries that
it was built with on GitHub Actions. And also the shared libraries can
be installed in various locations, so users usually need to set
`LD_LIBRARY_PATH`.

However, asking users to do the above works only for power users.
Reducing the runtime dependencies makes it usable for more users.
2024-01-08 17:27:05 +00:00

30 lines
832 B
YAML

name: Build for Linux
on:
workflow_dispatch:
inputs:
ref:
description: 'Ref to build (branch, tag or SHA)'
required: false
default: 'main'
jobs:
build:
name: Build SwiftFormat for Linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref }}
- name: Build it
run: |
swift build --configuration release --static-swift-stdlib --enable-dead-strip
SWIFTFORMAT_BIN_PATH=`swift build --configuration release --show-bin-path`
mv $SWIFTFORMAT_BIN_PATH/swiftformat "${HOME}/swiftformat_linux"
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: swiftformat_linux
path: ~/swiftformat_linux
retention-days: 5