Skip to content

Commit 7851766

Browse files
committed
Initial Workflow
1 parent 7493627 commit 7851766

File tree

11 files changed

+281
-108
lines changed

11 files changed

+281
-108
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
name: Build
22

33
on:
4-
# push:
5-
# branches: [ main ]
6-
# pull_request:
7-
# branches: [ main ]
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
88

99
jobs:
1010
macOS:
1111
name: Test
1212
runs-on: macOS-13
1313
steps:
1414
- uses: actions/checkout@v3
15-
- name: Display tuist commands in macOS
16-
run: swift package template
15+
- name: Display tailwindcss commands in macOS
16+
run: swift package tailwindcss --help
1717

1818
Linux:
1919
runs-on: ubuntu-latest

.github/workflows/check-github-release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
name: Check GitHub Release
22

33
on:
4-
# schedule:
5-
# Daily at 8:20 UTC and 20:20 UTC
6-
# - cron: '20 8,20 * * *'
7-
# # Enables manually running this workflow from the Actions tab
8-
# workflow_dispatch:
4+
schedule:
5+
Daily at 8:20 UTC and 20:20 UTC
6+
- cron: '20 8,20 * * *'
7+
# Enables manually running this workflow from the Actions tab
8+
workflow_dispatch:
99

1010
jobs:
1111
check:
1212
name: Check GitHub Release
1313
runs-on: ubuntu-latest
1414
env:
15-
BINARY_NAME: lefthook
16-
BINARY_REPO: evilmartians/lefthook
17-
PLUGIN_REPO: 21-DOT-DEV/swift-plugin-template
15+
BINARY_NAME: tailwindcss
16+
BINARY_REPO: tailwindlabs/tailwindcss
17+
PLUGIN_REPO: 21-DOT-DEV/swift-plugin-tailwindcss
1818
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1919
SEMANTIC_VERSIONING_REGEX: (v?[0-9]+\.[0-9]+\.[0-9]+)
2020
outputs:

.github/workflows/publish-artifact-bundle.yml

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
name: Publish Artifact Bundle
22

33
on:
4-
# workflow_call:
5-
# inputs:
6-
# binary_name:
7-
# required: true
8-
# type: string
9-
# binary_repo:
10-
# required: true
11-
# type: string
12-
# binary_version:
13-
# required: true
14-
# type: string
15-
# plugin_repo:
16-
# required: true
17-
# type: string
4+
workflow_call:
5+
inputs:
6+
binary_name:
7+
required: true
8+
type: string
9+
binary_repo:
10+
required: true
11+
type: string
12+
binary_version:
13+
required: true
14+
type: string
15+
plugin_repo:
16+
required: true
17+
type: string
1818

19-
# # Enables manually running this workflow from the Actions tab
20-
# workflow_dispatch:
21-
# inputs:
22-
# binary_name:
23-
# required: true
24-
# type: string
25-
# binary_repo:
26-
# required: true
27-
# type: string
28-
# binary_version:
29-
# required: true
30-
# type: string
31-
# plugin_repo:
32-
# required: true
33-
# type: string
19+
# Enables manually running this workflow from the Actions tab
20+
workflow_dispatch:
21+
inputs:
22+
binary_name:
23+
required: true
24+
type: string
25+
binary_repo:
26+
required: true
27+
type: string
28+
binary_version:
29+
required: true
30+
type: string
31+
plugin_repo:
32+
required: true
33+
type: string
3434

3535
jobs:
3636
publish:
@@ -47,15 +47,10 @@ jobs:
4747
run: |
4848
gh release download ${{ inputs.binary_version }} \
4949
-R "${{ inputs.binary_repo }}" \
50-
-p '*MacOS*64' \
51-
-p '*Linux*64' \
52-
-p '*Windows*64.exe' \
53-
-p '*.deb' \
54-
-p '*.rpm' \
50+
-p 'tailwindcss-macos-*' \
51+
-p 'tailwindcss-linux-*' \
52+
-p 'tailwindcss-windows-*.exe' \
5553
-D '${{ inputs.binary_name }}/Resources/template.artifactbundle'
56-
- name: Unzip Tuist
57-
run: |
58-
7z x "${{ inputs.binary_name }}/Resources/tuist.zip" -o"${{ inputs.binary_name }}/Resources/template.artifactbundle"
5954
- name: Update GitHub Env Vars
6055
run: |
6156
# The example binary includes a leading 'v' in the release version number. We drop it on the next line.
@@ -70,8 +65,10 @@ jobs:
7065
- name: Add executable permissions
7166
run: |
7267
# The example binaries for MacOS need the executable permission added.
73-
chmod +x "${{ env.ARTIFACT_PATH }}/${{ inputs.binary_name }}_${{ env.PLUGIN_VERSION }}_MacOS_arm64"
74-
chmod +x "${{ env.ARTIFACT_PATH }}/${{ inputs.binary_name }}_${{ env.PLUGIN_VERSION }}_MacOS_x86_64"
68+
chmod +x "${{ env.ARTIFACT_PATH }}/${{ inputs.binary_name }}-macos-arm64"
69+
chmod +x "${{ env.ARTIFACT_PATH }}/${{ inputs.binary_name }}-macos-x64"
70+
chmod +x "${{ env.ARTIFACT_PATH }}/${{ inputs.binary_name }}-linux-arm64"
71+
chmod +x "${{ env.ARTIFACT_PATH }}/${{ inputs.binary_name }}-linux-x64"
7572
- name: Zip Artifact Bundle
7673
run: |
7774
(cd "${{ env.ARTIFACT_PATH }}" && 7z a -tzip -mx=9 "${{ env.ARTIFACT_NAME }}" *)

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ DerivedData/
3434
timeline.xctimeline
3535
playground.xcworkspace
3636

37+
## macOS
38+
.DS_Store
39+
3740
# Swift Package Manager
3841
#
3942
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
@@ -88,3 +91,8 @@ fastlane/test_output
8891
# https://github.com/johnno1962/injectionforxcode
8992

9093
iOSInjectionProject/
94+
95+
# VSCode
96+
.vscode
97+
.aider*
98+
.env

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ ADD . /Linux
88
WORKDIR /Linux
99

1010
# List available plugins in Linux
11-
RUN swift package plugin template
11+
RUN swift package tailwindcss -h

Package.resolved

Lines changed: 14 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: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,36 @@
33
import PackageDescription
44

55
let package = Package(
6-
name: "template",
6+
name: "swift-plugin-tailwindcss",
77
products: [
8-
.plugin(
9-
name: "template",
10-
targets: [
11-
"TemplatePlugin"
12-
]
13-
)
8+
.executable(name: "tailwindcss", targets: ["TailwindExecutable"]),
9+
.plugin(name: "TailwindPlugin", targets: ["TailwindPlugin"])
10+
],
11+
dependencies: [
12+
.package(url: "https://github.com/21-DOT-DEV/swift-artifact-parser", exact: "0.0.1")
1413
],
15-
dependencies: [],
1614
targets: [
15+
.executableTarget(
16+
name: "TailwindExecutable",
17+
dependencies: [
18+
.product(name: "ArtifactParser", package: "swift-artifact-parser")
19+
]
20+
),
1721
.plugin(
18-
name: "TemplatePlugin",
22+
name: "TailwindPlugin",
1923
capability: .command(
2024
intent: .custom(
21-
verb: "template",
22-
description: "Execute commands defined by template."
25+
verb: "tailwindcss",
26+
description: "Run TailwindCSS CLI commands."
2327
)
2428
),
25-
dependencies: ["template"]
29+
dependencies: ["tailwindcss"]
2630
),
27-
// .binaryTarget(name: "template", path: "template.artifactbundle.zip"),
31+
// .binaryTarget(name: "tailwindcss", path: "tailwindcss.artifactbundle.zip"),
2832
.binaryTarget(
29-
name: "template",
30-
url: "https://github.com/GigaBitcoin/template-plugin/releases/download/0.0.1/template.artifactbundle.zip",
31-
checksum: "42e1e7a4f7d7586ec6d13b3e03cce5612ac237244cc3cb1e6de7c49416d04520"
33+
name: "tailwindcss",
34+
url: "https://github.com/21-DOT-DEV/swift-plugin-tailwindcss/releases/download/1.0.00/tailwindcss.artifactbundle.zip",
35+
checksum: "0fb225345a0c2a182b187f4b58d48d81f6d576e79020514046721e317fdaf74a"
3236
),
3337
],
3438
swiftLanguageVersions: [.v5]

Plugins/TemplatePlugin/TemplatePlugin.swift renamed to Plugins/TailwindPlugin/TailwindPlugin.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//
2-
// TemplatePlugin.swift
3-
// GigaBitcoin/template-plugin
2+
// TailwindCSSPlugin.swift
3+
// 21-DOT-DEV/swift-plugin-tailwindcss
44
//
5-
// Copyright (c) 2023 GigaBitcoin LLC
5+
// Copyright (c) 2025 21.dev
66
// Distributed under the MIT software license
77
//
88
// See the accompanying file LICENSE for information
@@ -12,12 +12,12 @@ import Foundation
1212
import PackagePlugin
1313

1414
@main
15-
struct TemplatePlugin: CommandPlugin {
15+
struct TailwindCSSPlugin: CommandPlugin {
1616
func performCommand(
1717
context: PackagePlugin.PluginContext,
1818
arguments: [String]
1919
) async throws {
20-
let binary = try context.tool(named: "template")
20+
let binary = try context.tool(named: "tailwindcss")
2121
let process = Process()
2222

2323
process.executableURL = URL(filePath: binary.path.string)
@@ -26,12 +26,12 @@ struct TemplatePlugin: CommandPlugin {
2626
try process.run()
2727
process.waitUntilExit()
2828

29-
// Check whether the `template` invocation was successful.
29+
// Check whether the `tailwindcss` invocation was successful.
3030
guard process.terminationReason == .exit && process.terminationStatus == 0 else {
3131
Diagnostics.error("""
32-
'template' invocation failed with a nonzero exit code: '\(process.terminationStatus)'.
32+
'tailwindcss' invocation failed with a nonzero exit code: '\(process.terminationStatus)'.
3333
34-
See 'swift package plugin template --help' for details.
34+
See 'swift package plugin tailwindcss --help' for details.
3535
"""
3636
)
3737

0 commit comments

Comments
 (0)