Skip to content

Commit 14e1cfc

Browse files
committed
Initial commit
Containing: * LametricFoundation for models * Lametric with the HTTP client and endpoints * lametric, a cli tool compatible with macOS and Linux
0 parents  commit 14e1cfc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2947
-0
lines changed

.github/media/Hero-Dark.png

13.1 KB
Loading

.github/media/Hero-Light.png

13 KB
Loading

.github/media/LametricSwift.png

2.09 KB
Loading

.github/workflows/release.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Release Lametric CLI
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build-linux:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Build
14+
run: swift build -c release --product lametric --arch x86_64 -Xswiftc -static-stdlib
15+
- name: Compress
16+
run: tar -czf lametric-${{ github.ref_name }}-linux-x86_64.tar.gz -C .build/x86_64-unknown-linux-gnu/release lametric
17+
- name: Upload artifact
18+
uses: actions/upload-artifact@v4
19+
with:
20+
name: lametric-linux
21+
path: lametric-${{ github.ref_name }}-linux-x86_64.tar.gz
22+
23+
build-macos-arm64:
24+
runs-on: macos-latest
25+
steps:
26+
- uses: swift-actions/setup-swift@v2
27+
with:
28+
swift-version: "6.1.0"
29+
- name: Get swift version
30+
run: swift --version
31+
- uses: actions/checkout@v3
32+
- name: Build
33+
run: swift build -c release --product lametric --arch arm64
34+
- name: Compress
35+
run: tar -czf lametric-${{ github.ref_name }}-darwin-arm64.tar.gz -C .build/arm64-apple-macosx/release lametric
36+
- name: Upload artifact
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: lametric-macos-arm64
40+
path: lametric-${{ github.ref_name }}-darwin-arm64.tar.gz
41+
42+
build-macos-x86_64:
43+
runs-on: macos-latest
44+
steps:
45+
- uses: swift-actions/setup-swift@v2
46+
with:
47+
swift-version: "6.1.0"
48+
- name: Get swift version
49+
run: swift --version
50+
- uses: actions/checkout@v3
51+
- name: Build
52+
run: swift build -c release --product lametric --arch x86_64
53+
- name: Compress
54+
run: tar -czf lametric-${{ github.ref_name }}-darwin-x86_64.tar.gz -C .build/x86_64-apple-macosx/release lametric
55+
- name: Upload artifact
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: lametric-macos-x86_64
59+
path: lametric-${{ github.ref_name }}-darwin-x86_64.tar.gz
60+
61+
release:
62+
runs-on: ubuntu-latest
63+
needs: [build-linux, build-macos-arm64, build-macos-x86_64]
64+
steps:
65+
- uses: actions/checkout@v3
66+
- name: Download Linux artifact
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: lametric-linux
70+
- name: Download macOS ARM64 artifact
71+
uses: actions/download-artifact@v4
72+
with:
73+
name: lametric-macos-arm64
74+
- name: Download macOS x86_64 artifact
75+
uses: actions/download-artifact@v4
76+
with:
77+
name: lametric-macos-x86_64
78+
- name: Create Release
79+
run: |
80+
gh release create ${{ github.ref_name }} \
81+
lametric-${{ github.ref_name }}-linux-x86_64.tar.gz \
82+
lametric-${{ github.ref_name }}-darwin-arm64.tar.gz \
83+
lametric-${{ github.ref_name }}-darwin-x86_64.tar.gz \
84+
--title "Lametric CLI ${{ github.ref_name }}" \
85+
--notes "Release ${{ github.ref_name }}"
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
xcuserdata/
5+
DerivedData/
6+
.swiftpm/configuration/registries.json
7+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
8+
.netrc

License.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) [year] [fullname]
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Package.resolved

Lines changed: 159 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// swift-tools-version: 6.1
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "lametric-swift",
8+
platforms: [
9+
.macOS(.v13)
10+
],
11+
products: [
12+
.executable(name: "lametric", targets: ["lametric-cli"]),
13+
.library(name: "Lametric", targets: ["Lametric"]),
14+
.library(name: "LametricFoundation", targets: ["LametricFoundation"]),
15+
],
16+
dependencies: [
17+
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.26.0"),
18+
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.5.0"),
19+
.package(url: "https://github.com/apple/swift-http-types.git", from: "1.0.0"),
20+
.package(url: "https://github.com/SwiftToolkit/swift-pretty-print", branch: "main"),
21+
.package(url: "https://github.com/mtynior/ColorizeSwift.git", from: "1.7.0")
22+
],
23+
targets: [
24+
.target(name: "LametricFoundation"),
25+
.target(
26+
name: "Lametric",
27+
dependencies: [
28+
.product(name: "AsyncHTTPClient", package: "async-http-client"),
29+
.product(name: "HTTPTypes", package: "swift-http-types"),
30+
.target(name: "LametricFoundation")
31+
]
32+
),
33+
.executableTarget(
34+
name: "lametric-cli",
35+
dependencies: [
36+
.target(name: "Lametric"),
37+
.product(name: "ArgumentParser", package: "swift-argument-parser"),
38+
.product(name: "PrettyPrint", package: "swift-pretty-print"),
39+
.product(name: "ColorizeSwift", package: "colorizeswift")
40+
]
41+
),
42+
]
43+
)

0 commit comments

Comments
 (0)