Skip to content

Instantly share code, notes, and snippets.

@libewa
Last active December 18, 2024 08:17
Show Gist options
  • Select an option

  • Save libewa/866b758b0dcd2f60e3ecfaa9ba06763c to your computer and use it in GitHub Desktop.

Select an option

Save libewa/866b758b0dcd2f60e3ecfaa9ba06763c to your computer and use it in GitHub Desktop.
name: Swift CI
env:
EXE_NAME: cute-table
on:
push:
branches: [ "main" ]
workflow_dispatch:
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ConorMacBride/install-package@v1
with:
apt: binutils tree git gnupg2 libc6-dev libcurl4 libedit2 libgcc-9-dev libpython2.7 libsqlite3-0 libstdc++-9-dev libxml2 libz3-dev pkg-config tzdata uuid-dev zlib1g-dev
- name: Download Swift
uses: valitydev/action-download-file@v1
with:
url: https://download.swift.org/swift-5.8.1-release/ubuntu2204/swift-5.8.1-RELEASE/swift-5.8.1-RELEASE-ubuntu22.04.tar.gz
target-path: .
- run: tar -xzvf swift-5.8.1-RELEASE-ubuntu22.04.tar.gz
- name: Build
run: ./swift-5.8.1-RELEASE-ubuntu22.04/usr/bin/swift build -v -c release
- run: cp .build/x86_64-unknown-linux-gnu/release/$EXE_NAME $EXE_NAME-linux
- uses: actions/upload-artifact@v3
with:
name: $EXE_NAME-linux
path: ./$EXE_NAME-linux
build-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: swift build -v -c release
- run: mv .build/x86_64-apple-macosx/release/$EXE_NAME $EXE_NAME-mac
- uses: actions/upload-artifact@v3
with:
name: $EXE_NAME-mac
path: ./$EXE_NAME-mac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment