Skip to content

Commit

Permalink
split tasks into two for rules and for plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
0xera committed Aug 28, 2024
1 parent d1340ba commit 3fb304c
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish
name: Publish Plugins

on:
release:
Expand All @@ -22,13 +22,13 @@ jobs:
- name: Grant Permission to Execute Gradle
run: chmod +x gradlew
- name: Grant Permission to scripts
run: chmod +x ./scripts/publish_all_remote.sh
run: chmod +x ./scripts/publish_plugins_remote.sh

- name: Release build
run: ./gradlew build

- name: Publish to MavenCentral
run: ./scripts/publish_all_remote.sh
run: ./scripts/publish_plugins_remote.sh
env:
REMOTE_REPO_PUBLIC_URL: ${{ secrets.ARTIFACTORY_PUBLIC_URL }}
REMOTE_REPO_PUBLIC_USER: ${{ secrets.ARTIFACTORY_PUBLIC_USER }}
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/publish_rules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Rules

on:
workflow_dispatch:

jobs:
publish:
name: Publish
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v3.1.0

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17

- name: Grant Permission to Execute Gradle
run: chmod +x gradlew
- name: Grant Permission to scripts
run: chmod +x ./scripts/publish_rules_remote.sh

- name: Release build
run: ./gradlew build

- name: Publish to MavenCentral
run: ./scripts/publish_rules_remote.sh
env:
REMOTE_REPO_PUBLIC_URL: ${{ secrets.ARTIFACTORY_PUBLIC_URL }}
REMOTE_REPO_PUBLIC_USER: ${{ secrets.ARTIFACTORY_PUBLIC_USER }}
REMOTE_REPO_PUBLIC_PASSWORD: ${{ secrets.ARTIFACTORY_PUBLIC_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ Both features can be disabled in preferences:
You can download and install it from the jar file for [Iguana](idea-plugin/vkompose/vkompose-0.2.6-Iguana.jar), [Jellyfish](idea-plugin/vkompose/vkompose-0.2.6-Jellyfish.jar), [Koala](idea-plugin/vkompose/vkompose-0.2.6-Koala.jar) or [Ladybug](idea-plugin/vkompose/vkompose-0.2.6-Ladybug.jar) versions of AS.

### [Detekt](https://github.com/detekt/detekt) Rule
There is one rule available that checks the skippability of functions. To use it, apply the dependency via the detektPlugin configuration in the dependencies block.

Current version is `0.6`.

There is one rule available that checks the skippability of functions or stability of parameters. To use it, apply the dependency via the detektPlugin configuration in the dependencies block.
```kotlin
dependencies {
detektPlugins("com.vk.vkompose:detekt:0.6")
Expand Down
26 changes: 26 additions & 0 deletions scripts/publish_plugins_remote.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function checkStatus() {
if [[ $? != 0 ]]; then
echo "Publish failed!"
exitWithCleanup
fi
}

./gradlew :gradle-plugin:sub-plugin:composable-skippability-checker:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :gradle-plugin:sub-plugin:compose-test-tag:applier:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :gradle-plugin:sub-plugin:compose-test-tag:cleaner:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :gradle-plugin:sub-plugin:compose-test-tag:drawer:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :gradle-plugin:sub-plugin:compose-source-information:cleaner:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :gradle-plugin:sub-plugin:recompose:highlighter:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :gradle-plugin:sub-plugin:recompose:logger:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :gradle-plugin:composite:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :compiler-plugin:composable-skippability-checker:plugin:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :compiler-plugin:compose-test-tag:cleaner:plugin:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :compiler-plugin:compose-test-tag:applier:plugin:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :compiler-plugin:compose-test-tag:applier:runtime:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :compiler-plugin:compose-test-tag:drawer:plugin:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :compiler-plugin:compose-test-tag:drawer:runtime:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :compiler-plugin:compose-source-information:cleaner:plugin:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :compiler-plugin:recompose:highlighter:plugin:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :compiler-plugin:recompose:highlighter:runtime:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :compiler-plugin:recompose:logger:plugin:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :compiler-plugin:recompose:logger:runtime:publishAllPublicationsToPublicRemoteRepository || checkStatus
9 changes: 9 additions & 0 deletions scripts/publish_rules_remote.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function checkStatus() {
if [[ $? != 0 ]]; then
echo "Publish failed!"
exitWithCleanup
fi
}

./gradlew :rules:common:publishAllPublicationsToPublicRemoteRepository || checkStatus
./gradlew :rules:detekt:publishAllPublicationsToPublicRemoteRepository || checkStatus

0 comments on commit 3fb304c

Please sign in to comment.