Skip to content

Commit

Permalink
[#495] Remove template workflows when using template
Browse files Browse the repository at this point in the history
  • Loading branch information
blyscuit committed Sep 28, 2023
1 parent 0e72643 commit 3fcb789
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions .github/project_workflows/publish_docs_to_wiki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish docs to Wiki

on:
push:
paths:
- .github/wiki/**
branches:
- main
- master

jobs:
publish_docs_to_wiki:
name: Publish Wiki
uses: nimblehq/github-actions-workflows/.github/workflows/publish_wiki.yml@0.1.0
with:
USER_NAME: team-nimblehq
USER_EMAIL: dev@nimblehq.co
secrets:
USER_TOKEN: ${{ secrets.NIMBLE_DEV_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,18 @@ extension FileManager {
}
}

func createFile(name: String, at directory: String) {
func createDirectory(path: String) {
let currentDirectory = currentDirectoryPath
do {
try createDirectory(atPath: "\(currentDirectory)/\(directory)", withIntermediateDirectories: true, attributes: nil)
try createDirectory(atPath: "\(currentDirectory)/\(path)", withIntermediateDirectories: true, attributes: nil)
} catch {
print("Error \(error)")
}
}

func createFile(name: String, at directory: String) {
let currentDirectory = currentDirectoryPath
createDirectory(path: directory)
createFile(atPath: "\(currentDirectory)\(directory)\(name)", contents: nil)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ struct SetUpCICDService {
print("Setting template for Github Actions")
fileManager.removeItems(in: "bitrise.yml")
fileManager.removeItems(in: "codemagic.yaml")
fileManager.removeItems(in: ".github/workflows")
fileManager.createDirectory(path: ".github/workflows")
fileManager.moveFiles(in: ".github/project_workflows", to: ".github/workflows")
fileManager.removeItems(in: ".github/project_workflows")
case .bitrise:
print("Setting template for Bitrise")
fileManager.removeItems(in: "codemagic.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extension iOSTemplateMaker {
var projectName: String?
@Option(help: "The minimum iOS version (14.0)")
var minimumVersion: String?
@Option(help: "The user interface frameword (SwiftUI or UIKit)")
@Option(help: "The user interface framework (SwiftUI or UIKit)")
var interface: String?

mutating func run() {
Expand Down

0 comments on commit 3fcb789

Please sign in to comment.