Skip to content

Commit dc7323f

Browse files
committed
Chore, merge Actions/SetUp/action.yml
1 parent 1247dd4 commit dc7323f

File tree

6 files changed

+59
-87
lines changed

6 files changed

+59
-87
lines changed

Actions/Comment/action.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,19 @@ inputs:
2121
name: Comment
2222
runs:
2323
steps:
24-
- name: Setup Swift, Mint, Cache, etc.
25-
uses: ${{ github.action_path }}/../SetUp
24+
- name: Setup Swift
25+
uses: swift-actions/setup-swift@v2
26+
with:
27+
swift-version: 5.10.0
28+
- name: Create Mintfile
29+
run: echo Wei18/GitHubSwiftActions@${{ github.action_ref }} > ${{ github.action_path }}/Mintfile
30+
shell: bash
31+
- name: Setup Mint
32+
uses: irgaly/setup-mint@v1
33+
with:
34+
cache-prefix: GitHubSwiftActions
35+
mint-directory: ${{ github.action_path }}
36+
mint-executable-directory: ~/.mint/bin
2637
- env:
2738
ANCHOR: ${{ inputs.anchor }}
2839
BODY: ${{ inputs.body }}

Actions/Release/action.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,19 @@ inputs:
1818
name: Release
1919
runs:
2020
steps:
21-
- name: Setup Swift, Mint, Cache, etc.
22-
uses: ${{ github.action_path }}/../SetUp
21+
- name: Setup Swift
22+
uses: swift-actions/setup-swift@v2
23+
with:
24+
swift-version: 5.10.0
25+
- name: Create Mintfile
26+
run: echo Wei18/GitHubSwiftActions@${{ github.action_ref }} > ${{ github.action_path }}/Mintfile
27+
shell: bash
28+
- name: Setup Mint
29+
uses: irgaly/setup-mint@v1
30+
with:
31+
cache-prefix: GitHubSwiftActions
32+
mint-directory: ${{ github.action_path }}
33+
mint-executable-directory: ~/.mint/bin
2334
- env:
2435
OWNER: ${{ inputs.owner }}
2536
REF: ${{ inputs.ref }}

Actions/SetUp/action.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

Sources/YamlWriter/CLIYamlBuilder.swift

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ struct CLIYamlBuilder {
4646
"inputs": inputs,
4747
"runs": [
4848
"using": "composite",
49-
"steps": [
50-
[
51-
"name": "Setup Swift, Mint, Cache, etc.",
52-
"uses": "./Actions/SetUp",
53-
],
49+
"steps": SetUpActionBuilder().build() + [
5450
[
5551
"name": "Run \(name)",
5652
"run": "~/.mint/bin/mint run \(repo) \(name)",
@@ -65,3 +61,34 @@ struct CLIYamlBuilder {
6561
return try Yams.dump(object: action, width: -1, sortKeys: true)
6662
}
6763
}
64+
65+
private struct SetUpActionBuilder {
66+
func build() -> [[String: Any]] {
67+
let content = "\(SwiftPackageConfig.current.repo)@${{ github.action_ref }}"
68+
let action: [[String: Any]] = [
69+
[
70+
"name": "Setup Swift",
71+
"uses": "swift-actions/setup-swift@v2",
72+
"with": [
73+
"swift-version": "5.10.0",
74+
],
75+
],
76+
[
77+
"name": "Create Mintfile",
78+
"run": "echo \(content) > ${{ github.action_path }}/Mintfile",
79+
"shell": "bash",
80+
],
81+
[
82+
"name": "Setup Mint",
83+
"uses": "irgaly/setup-mint@v1",
84+
"with": [
85+
"mint-directory": "${{ github.action_path }}",
86+
"mint-executable-directory": "~/.mint/bin",
87+
"cache-prefix": "GitHubSwiftActions",
88+
],
89+
90+
],
91+
]
92+
return action
93+
}
94+
}

Sources/YamlWriter/SetUpActionBuilder.swift

Lines changed: 0 additions & 46 deletions
This file was deleted.

Sources/YamlWriter/main.swift

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,13 @@ struct YamlWriterCLI: ParsableCommand {
2222
try makeCLIYaml(
2323
command: Release.self,
2424
description: "Runs the process of creating GitHub Release with bump type and git ref")
25-
26-
try makeMintfile()
2725
}
2826

2927
private func makeCLIYaml(command: ParsableCommand.Type, description: String) throws {
3028
let yaml = try CLIYamlBuilder().build(
3129
command: command,
3230
description: description)
33-
34-
let actionPath = try FileBuilder(
35-
content: yaml,
36-
command: command,
37-
basePath: packDirectory().appendingPathComponent("Actions")
38-
).build()
39-
print(actionPath)
40-
}
41-
42-
private func makeMintfile() throws {
43-
struct SetUp: ParsableCommand {}
44-
let command = SetUp.self
45-
let yaml = try SetUpActionBuilder().build()
31+
4632
let actionPath = try FileBuilder(
4733
content: yaml,
4834
command: command,

0 commit comments

Comments
 (0)