Skip to content

Commit

Permalink
feat: Add Flank GitHub action (#1660)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotradamczyk5 authored Mar 5, 2021
1 parent f5c8b1c commit 8ee557b
Show file tree
Hide file tree
Showing 11 changed files with 293 additions and 119 deletions.
19 changes: 19 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Flank'
description: 'Run Flank from Github actions!'
inputs:
version:
description: 'Flank version to run'
required: false
runs:
using: "composite"
steps:
- name: Download flankScripts
run: |
curl -L https://github.com/Flank/flank/releases/download/flank-scripts-1.8.0/flank-scripts.jar --output flank-scripts.jar
echo 'java -jar ./flank-scripts.jar "$@"' > flankScripts
chmod +x flankScripts
shell: bash
- id: download_flank
run: |
./flankScripts github download_flank --version=${{ inputs.version }}
shell: bash
14 changes: 5 additions & 9 deletions docs/flank-scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ Properties are skipped by git and should not be attached to a commit. Note, the
│ │ ├── CopyIssuePropertiesCommand.kt
│ │ ├── DeleteOldTagCommand.kt
│ │ ├── DeleteReleaseCommand.kt
│ │ ├── DownloadFlankCommand.kt
│ │ ├── GitHubCommand.kt
│ │ └── MakeReleaseCommand.kt
│ ├── integrationtests
Expand All @@ -165,11 +166,9 @@ Properties are skipped by git and should not be attached to a commit. Note, the
│ │ ├── ApplyToIdeCommand.kt
│ │ └── LinterCommand.kt
│ ├── release
│ │ ├── DeleteSnapshotCommand.kt
│ │ ├── GenerateReleaseNotesCommand.kt
│ │ ├── NextTagCommand.kt
│ │ ├── ReleaseCommand.kt
│ │ └── SyncWithMavenCentralCommand.kt
│ │ └── ReleaseCommand.kt
│ └── testartifacts
│ ├── DownloadCommand.kt
│ ├── LinkCommand.kt
Expand Down Expand Up @@ -256,17 +255,14 @@ Properties are skipped by git and should not be attached to a commit. Note, the
│ │ ├── CopyGitHubProperties.kt
│ │ ├── DeleteOldRelease.kt
│ │ ├── DeleteOldTag.kt
│ │ ├── DownloadFlank.kt
│ │ └── ReleaseFlank.kt
│ ├── integrationtests
│ │ ├── ProcessIntegrationTestsResult.kt
│ │ └── common
│ │ ├── ITResults.kt
│ │ ├── IntegrationContext.kt
│ │ ├── ITResult.kt
│ │ ├── IntegrationResultContext.kt
│ │ └── PrepareMessage.kt
│ ├── jfrog
│ │ ├── DeleteOldSnapshot.kt
│ │ ├── JFrogCommandHelper.kt
│ │ └── SyncMaven.kt
│ ├── linter
│ │ ├── ApplyKtlintToIdea.kt
│ │ └── LinkGitHooks.kt
Expand Down
123 changes: 82 additions & 41 deletions docs/flank-scripts/command_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ___
- `delete_old_tag` - Delete old tag on GitHub
- `delete_release` - Delete old release on github
- `make_release` - Make new Github release
- `download_flank` - Downloads flank.jar with selected version.

___

Expand Down Expand Up @@ -78,47 +79,87 @@ ___

```bash
flank-scripts/
└── cli/
├── assemble/
│ ├── android/
│ │ └── AppCommand.kt
│ ├── ios/
│ │ ├── AllCommand.kt
│ │ ├── EarlGreyCommand.kt
│ │ ├── FlankExampleCommand.kt
│ │ ├── GameLoopCommand.kt
│ │ └── TestPlansCommand.kt
│ └── GoArtifactsCommand.kt
├── firebase/
│ ├── CheckForSdkUpdatesCommand.kt
│ ├── GenerateClientCommand.kt
│ └── UpdateApiCommand.kt
├── github/
│ ├── DeleteOldTagCommand.kt
│ ├── DeleteGithubReleaseCommand.kt
│ ├── MakeGithubReleaseCommand.kt
│ ├── CopyIssuePropertiesCommand.kt
├── gradle/
│ └── UpdateDependenciesCommand.kt
├── integrationtests/
│ └── ProcessResultsCommand.kt
├── linter/
│ ├── ApplyToGitHooksCommand.kt
│ └── ApplyToIdeCommand.kt
├── release/
│ ├── DeleteSnapshotCommand.kt
│ ├── GenerateReleaseNotesCommand.kt
│ ├── NextTagCommand.kt
│ └── SyncWithMavenCentralCommand.kt
└── testartifacts/
├── DownloadCommand.kt
├── LinkCommand.kt
├── PrepareCommand.kt
├── RemoveRemoteCommand.kt
├── ResolveCommand.kt
├── UnzipCommand.kt
├── UploadCommand.kt
└── ZipCommand.kt
├── cli
│ ├── Main.kt
│ ├── assemble
│ │ ├── AssembleCommand.kt
│ │ ├── FlankCommand.kt
│ │ ├── GoCommand.kt
│ │ ├── android
│ │ │ ├── AndroidCommand.kt
│ │ │ └── AppCommand.kt
│ │ └── ios
│ │ ├── EarlGreyCommand.kt
│ │ ├── ExampleCommand.kt
│ │ ├── FlankExampleCommand.kt
│ │ ├── FtlCommand.kt
│ │ ├── GameLoopExampleCommand.kt
│ │ ├── IosCommand.kt
│ │ ├── RunFtlLocalCommand.kt
│ │ └── TestPlansExample.kt
│ ├── dependencies
│ │ ├── DependenciesCommand.kt
│ │ ├── InstallXcPrettyCommand.kt
│ │ ├── SetupIosEnvCommand.kt
│ │ ├── UniversalFrameworkCommand.kt
│ │ ├── UpdateBinariesCommand.kt
│ │ └── UpdateCommand.kt
│ ├── firebase
│ │ ├── CheckForSdkUpdatesCommand.kt
│ │ ├── FirebaseCommand.kt
│ │ ├── GenerateClientCommand.kt
│ │ └── UpdateApiCommand.kt
│ ├── github
│ │ ├── CopyIssuePropertiesCommand.kt
│ │ ├── DeleteOldTagCommand.kt
│ │ ├── DeleteReleaseCommand.kt
│ │ ├── DownloadFlankCommand.kt
│ │ ├── GitHubCommand.kt
│ │ └── MakeReleaseCommand.kt
│ ├── integrationtests
│ │ ├── IntegrationTestsCommand.kt
│ │ └── ProcessResultCommand.kt
│ ├── linter
│ │ ├── ApplyToGitHooksCommand.kt
│ │ ├── ApplyToIdeCommand.kt
│ │ └── LinterCommand.kt
│ ├── release
│ │ ├── GenerateReleaseNotesCommand.kt
│ │ ├── NextTagCommand.kt
│ │ └── ReleaseCommand.kt
│ └── testartifacts
│ ├── DownloadCommand.kt
│ ├── LinkCommand.kt
│ ├── PrepareCommand.kt
│ ├── RemoveRemoteCommand.kt
│ ├── ResolveCommand.kt
│ ├── TestArtifactsCommand.kt
│ ├── UnzipCommand.kt
│ ├── UploadCommand.kt
│ └── ZipCommand.kt
├── data
│ ├── github
│ │ ├── GitHubErrorResponse.kt
│ │ ├── GithubApi.kt
│ │ ├── commons
│ │ │ └── LastWorkflowRunDate.kt
│ │ └── objects
│ │ ├── GitHubCommit.kt
│ │ ├── GitHubCreateIssue.kt
│ │ ├── GitHubCreateIssueComment.kt
│ │ ├── GitHubRelease.kt
│ │ ├── GitHubSetAssigneesRequest.kt
│ │ ├── GitHubSetLabelsRequest.kt
│ │ ├── GitHubUpdateIssue.kt
│ │ ├── GitHubWorkflowRun.kt
│ │ └── GithubPullRequest.kt
│ └── zenhub
│ ├── ZenHubAPI.kt
│ ├── ZenHubIssue.kt
│ └── objects
│ └── ConvertToEpicRequest.kt


```

### Usage
Expand Down
91 changes: 39 additions & 52 deletions docs/flank-scripts/ops_structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,82 +30,69 @@ Ops package structure and file organization are presented on the tree below:
│ │ ├── BuildIosTestArtifacts.kt
│ │ ├── BuildTestPlansExample.kt
│ │ ├── IosBuildCommand.kt
│ │ ├── LipoHelper.kt
│ │ ├── RunFtlLocal.kt
│ │ └── UniversalFramework.kt
│ ├── common
│ │ ├── ConventionalCommitFormatter.kt
│ │ ├── DownloadSoftware.kt
│ │ ├── EarlGreyExampleConsts.kt
│ │ ├── GenerateChangeLog.kt
│ │ └── ReleaseNotesWithType.kt
│ ├── dependencies
│ │ ├── DependenciesResultCheck.kt
│ │ ├── DependencyExtensions.kt
│ │ ├── DependencyUpdate.kt
│ │ ├── DownloadSoftware.kt
│ │ ├── FindOutdatedDependencies.kt
│ │ ├── FindVersionInLines.kt
│ │ ├── GradleDependency.kt
│ │ ├── InstallXcPretty.kt
│ │ ├── SetupIosEnv.kt
│ │ ├── UpdateAllDependencies.kt
│ │ ├── UpdateDependencies.kt
│ │ ├── UpdateGradle.kt
│ │ ├── UpdatePlugins.kt
│ │ ├── UpdateVersionsInFile.kt
│ │ └── updatebinaries
│ │ ├── UpdateAtomic.kt
│ │ ├── UpdateBinaries.kt
│ │ ├── UpdateLlvm.kt
│ │ └── UpdateSwift.kt
│ │ └── common
│ │ ├── DependenciesResultCheck.kt
│ │ ├── DependencyExtensions.kt
│ │ ├── DependencyUpdate.kt
│ │ ├── FindOutdatedDependencies.kt
│ │ ├── GradleDependency.kt
│ │ ├── UpdateDependencies.kt
│ │ ├── UpdateGradle.kt
│ │ ├── UpdatePlugins.kt
│ │ └── UpdateVersionsInFile.kt
│ ├── firebase
│ │ ├── CheckForSDKUpdateCommand.kt
│ │ ├── CheckForSDKUpdate.kt
│ │ ├── CommitList.kt
│ │ ├── Extensions.kt
│ │ ├── GenerateJavaClient.kt
│ │ ├── LastSDKUpdateRun.kt
│ │ ├── OpenedUpdates.kt
│ │ ├── SDKUpdateContext.kt
│ │ └── UpdateApiJson.kt
│ │ ├── UpdateApiJson.kt
│ │ └── common
│ │ └── Extensions.kt
│ ├── github
│ │ ├── CopyGitHubProperties.kt
│ │ ├── DeleteOldRelease.kt
│ │ ├── DeleteOldTag.kt
│ │ ├── FindReferenceIssue.kt
│ │ ├── ReleaseFlank.kt
│ │ ├── SetAssignees.kt
│ │ └── SetLabels.kt
│ │ ├── DownloadFlank.kt
│ │ └── ReleaseFlank.kt
│ ├── integrationtests
│ │ ├── CommitList.kt
│ │ ├── Extensions.kt
│ │ ├── IntegrationContext.kt
│ │ ├── IssueList.kt
│ │ ├── PrepareMessage.kt
│ │ ├── ProcessIntegrationTestsResult.kt
│ │ └── WorkflowSummary.kt
│ │ └── common
│ │ ├── ITResult.kt
│ │ ├── IntegrationResultContext.kt
│ │ └── PrepareMessage.kt
│ ├── linter
│ │ ├── ApplyKtlintToIdea.kt
│ │ └── LinkGitHooks.kt
│ ├── release
│ │ ├── AppendReleaseNotes.kt
│ │ ├── CreateReleaseNotes.kt
│ │ ── NextReleaseTag.kt
│ └── jfrog
│ │ ├── DeleteOldSnapshot.kt
│ │ ├── JFrogCommandHelper.kt
│ │ ── SyncMaven.kt
── testartifacts
├── ArtifactsArchive.kt
├── Constants.kt
├── Context.kt
├── DownloadFixtures.kt
├── IsNewVersionAvailable.kt
── LinkArtifacts.kt
── PrepareTestArtifacts.kt
│ ├── RemoveRemoteCopy.kt
│ ├── ResolveArtifacts.kt
│ ├── TestArtifactsRepo.kt
── UploadFixtures.kt
│ └── ZipArtifacts.kt
│ │ ── NextReleaseTag.kt
── testartifacts
│ │ ├── ArtifactsArchive.kt
│ │ ├── Context.kt
│ │ ── DownloadFixtures.kt
│ ├── Helpers.kt
├── LinkArtifacts.kt
├── PrepareTestArtifacts.kt
├── RemoveRemoteCopy.kt
├── ResolveArtifacts.kt
├── UploadFixtures.kt
── ZipArtifacts.kt
── updatebinaries
│ ├── UpdateAtomic.kt
│ ├── UpdateBinaries.kt
│ ├── UpdateLlvm.kt
── UpdateSwift.kt


```
2 changes: 1 addition & 1 deletion flank-scripts/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ shadowJar.apply {
}
}
// <breaking change>.<feature added>.<fix/minor change>
version = "1.7.3"
version = "1.8.0"
group = "com.github.flank"

application {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package flank.scripts.cli.github

import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.parameters.options.option
import flank.scripts.ops.github.downloadFlank
import kotlinx.coroutines.runBlocking

object DownloadFlankCommand : CliktCommand(
name = "download_flank",
help = "Downloads flank.jar with selected version."

) {

private val version by option(
"--version", "-v",
help = "If the version not set, the latest version will be used."
)

override fun run() = runBlocking {
downloadFlank(version)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ object GitHubCommand : CliktCommand(
CopyIssuePropertiesCommand,
DeleteReleaseCommand,
DeleteOldTagCommand,
MakeReleaseCommand
MakeReleaseCommand,
DownloadFlankCommand
)
}

Expand Down
Loading

0 comments on commit 8ee557b

Please # to comment.