diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 961f0ff..e158960 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -2,39 +2,31 @@ on:
release:
types: [created]
-name: Create new formula version
+name: Upload tarball for release
jobs:
upload-release:
- name: Create new formula version
+ name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- - name: Checkout formula repo
- uses: actions/checkout@v2
- with:
- repository: ${{ github.repository_owner }}/homebrew-makecolors
- token: ${{ secrets.PUBLISH_FORMULA_TOKEN }}
- - name: Update formula
+ - name: Set release tarball name
run: |
- cat << EOF > Formula/make-colors.rb
- class MakeColors < Formula
- desc "Converts a simple list of color definitions to asset catalogs for Xcode and resource XML for Android"
- homepage "https://github.com/${{ github.repository }}"
- url "https://github.com/${{ github.repository }}.git", :tag => "${{ github.event.release.tag_name }}", :revision => "${{ github.sha }}"
- head "https://github.com/${{ github.repository }}.git"
- license "MIT"
+ echo "TARBALL_NAME=$(echo MakeColors-${GITHUB_REF##*/v})" >> $GITHUB_ENV
- depends_on :xcode => ["14.0", :build]
+ - name: Checkout code
+ uses: actions/checkout@v2
- def install
- system "make", "install", "prefix=#{prefix}"
- end
- end
- EOF
+ - name: Pack tarball
+ run: |
+ git archive HEAD --prefix=${{ env.TARBALL_NAME }}/ | bzip2 > ${{ env.TARBALL_NAME }}.tar.bz2
- git config user.name github-actions
- git config user.email github-actions@github.com
-
- git add Formula/make-colors.rb
- git commit -m "Update formula for ${{ github.event.release.tag_name }}"
- git push
+ - name: Upload Release Asset
+ id: upload
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ github.event.release.upload_url }}
+ asset_path: ./${{ env.TARBALL_NAME }}.tar.bz2
+ asset_name: ${{ env.TARBALL_NAME }}.tar.bz2
+ asset_content_type: application/x-bzip2
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 3b150ab..be00eaa 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -5,7 +5,7 @@ on:
jobs:
BuildAndTest:
- runs-on: macos-12
+ runs-on: macos-latest
steps:
- uses: actions/checkout@v1
diff --git a/.swift-version b/.swift-version
index 760606e..d346e2a 100644
--- a/.swift-version
+++ b/.swift-version
@@ -1 +1 @@
-5.7
+5.3
diff --git a/Docs/assetcatalog.png b/Docs/assetcatalog.png
deleted file mode 100644
index 0340a76..0000000
Binary files a/Docs/assetcatalog.png and /dev/null differ
diff --git a/Docs/html.png b/Docs/html.png
deleted file mode 100644
index 46391a2..0000000
Binary files a/Docs/html.png and /dev/null differ
diff --git a/Example/.gitignore b/Example/.gitignore
deleted file mode 100644
index 5d1cee6..0000000
--- a/Example/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Example.*
-!Example.txt
diff --git a/Example/Example.txt b/Example/Example.txt
deleted file mode 100644
index c2be7ac..0000000
--- a/Example/Example.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Base/Green #8fd151
-Base/PaleGreen #d0f9a9
-Base/Red rgb(249, 39, 7)
-TransparentRed rgba(255, 0, 0, 128)
-Base/Yellow #ff0
-
-Error @Base/Red
-Warning @Base/Yellow
-Good @Base/Green
-
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 98c4dcc..0000000
--- a/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-prefix ?= /usr/local
-bindir = $(prefix)/bin
-
-build:
- swift build -c release --disable-sandbox
-
-install: build
- install -d "$(bindir)"
- install ".build/release/MakeColors" "$(bindir)/make-colors"
-
-uninstall:
- rm -rf "$(bindir)/make-colors"
-
-clean:
- rm -rf .build
-
-.PHONY: build install uninstall clean
diff --git a/Package.resolved b/Package.resolved
index 717a74e..228d9c6 100644
--- a/Package.resolved
+++ b/Package.resolved
@@ -1,23 +1,16 @@
{
- "pins" : [
- {
- "identity" : "rbbjson",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/robb/RBBJSON",
- "state" : {
- "branch" : "main",
- "revision" : "102c970283e105d7c5be2e29630db29c808c20eb"
+ "object": {
+ "pins": [
+ {
+ "package": "swift-argument-parser",
+ "repositoryURL": "https://github.com/apple/swift-argument-parser",
+ "state": {
+ "branch": null,
+ "revision": "92646c0cdbaca076c8d3d0207891785b3379cbff",
+ "version": "0.3.1"
+ }
}
- },
- {
- "identity" : "swift-argument-parser",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/apple/swift-argument-parser",
- "state" : {
- "revision" : "9f39744e025c7d377987f30b03770805dcb0bcd1",
- "version" : "1.1.4"
- }
- }
- ],
- "version" : 2
+ ]
+ },
+ "version": 1
}
diff --git a/Package.swift b/Package.swift
index 05a09d5..ea9aaaa 100644
--- a/Package.swift
+++ b/Package.swift
@@ -1,4 +1,4 @@
-// swift-tools-version:5.7
+// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
@@ -6,25 +6,27 @@ import PackageDescription
let package = Package(
name: "MakeColors",
platforms: [
- .macOS("12.0"),
+ .macOS(.v10_15),
],
dependencies: [
- .package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "1.1.4")),
- .package(url: "https://github.com/robb/RBBJSON", branch: "main"),
+ .package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "0.3.1")),
],
targets: [
- .executableTarget(
+ .target(
name: "MakeColors",
+ dependencies: [
+ "LibMakeColors",
+ ]
+ ),
+ .target(
+ name: "LibMakeColors",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
]
),
.testTarget(
name: "MakeColorsTests",
- dependencies: [
- "MakeColors",
- .product(name: "RBBJSON", package: "RBBJSON"),
- ]
+ dependencies: ["LibMakeColors"]
),
]
)
diff --git a/README.md b/README.md
index b9b8980..23d4152 100644
--- a/README.md
+++ b/README.md
@@ -2,70 +2,21 @@
Converts a simple list of color definitions to asset catalogs for Xcode, resource XML for Android or an HTML preview.
-## Installation
-
-Install via [Homebrew](https://brew.sh):
-
-```
-brew tap 5sw/makecolors
-brew install make-colors
-```
-
-If you don’t use Homebrew you can also install directly from source. Clone the repository or download the release and run `make install` inside the working copy.
-
-## Usage
-
-```
-USAGE: make-colors [--ios] [--android] [--html] [--prefix ] [--output