Skip to content

Commit 338c121

Browse files
committed
Create Actions/Release/action.yml
1 parent b839793 commit 338c121

File tree

3 files changed

+43
-5
lines changed

3 files changed

+43
-5
lines changed

Actions/Release/action.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
description: Runs the process of creating GitHub Release with bump type and git ref
2+
inputs:
3+
bumpType:
4+
description: The bumpType for the command.
5+
required: true
6+
gitRef:
7+
description: The gitRef for the command.
8+
required: true
9+
owner:
10+
description: The owner for the command.
11+
required: true
12+
repo:
13+
description: The repo for the command.
14+
required: true
15+
token:
16+
description: The token for the command.
17+
required: true
18+
name: Release
19+
runs:
20+
steps:
21+
- name: Setup Swift, Mint, Cache, etc.
22+
uses: Wei18/GitHubSwiftActions/Actions/SetUp@main
23+
- env:
24+
BUMPTYPE: ${{ inputs.bumpType }}
25+
GITREF: ${{ inputs.gitRef }}
26+
OWNER: ${{ inputs.owner }}
27+
REPO: ${{ inputs.repo }}
28+
TOKEN: ${{ inputs.token }}
29+
name: Run Release
30+
run: ~/.mint/bin/mint run Wei18/GitHubSwiftActions@main Release
31+
shell: bash
32+
using: composite

Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ let package = Package(
7676
.product(name: "ArgumentParser", package: "swift-argument-parser"),
7777
.product(name: "Yams", package: "Yams"),
7878
.target(name: "CommentCLI"),
79+
.target(name: "ReleaseCLI"),
7980
]
8081
),
8182
.target(name: "Extensions")

Sources/YamlWriter/main.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,32 @@
88
import Foundation
99
import ArgumentParser
1010
import CommentCLI
11+
import ReleaseCLI
1112

1213
/// A command-line interface for building a GitHub Composite Action YAML based on a ParsableCommand.
1314
struct YamlWriterCLI: ParsableCommand {
1415

1516
/// Generates the GitHub Composite Action YAML.
1617
func run() throws {
17-
try makeCommentCLIYaml()
18+
try makeCLIYaml(
19+
command: Comment.self,
20+
description: "Runs the process of adding or updating a comment in a GitHub issue or pull request.")
21+
22+
try makeCLIYaml(
23+
command: Release.self,
24+
description: "Runs the process of creating GitHub Release with bump type and git ref")
1825
}
1926

20-
private func makeCommentCLIYaml() throws {
21-
let command = Comment.self
27+
private func makeCLIYaml(command: ParsableCommand.Type, description: String) throws {
2228
let yaml = try CLIYamlBuilder().build(
2329
command: command,
24-
description: "Runs the process of adding or updating a comment in a GitHub issue or pull request.")
30+
description: description)
2531

2632
let actionPath = try FileBuilder(
2733
content: yaml,
2834
command: command,
2935
basePath: packDirectory().appendingPathComponent("Actions")
3036
).build()
31-
3237
print(actionPath)
3338
}
3439

0 commit comments

Comments
 (0)