diff --git a/.github/readme.md b/.github/readme.md index d77ee1d3..d63e5075 100644 --- a/.github/readme.md +++ b/.github/readme.md @@ -8,6 +8,37 @@ vgo is a tool for optimizing vector artwork files that helps ensure your vector Download the distribution from the releases page and ensure it has execute permission. On macOS & Linux run `chmod +x vgo`. +## Gradle Plugin +Add the plugin to your buildscript classpath. +``` +buildscript { + repositories { + mavenCentral() + } + + dependencies { + classpath "com.jzbrooks:vgo-plugin:1.4.0" + } +} +``` + +Then, in the relevant project, add the plugin. +``` +plugins { + id 'com.jzbrooks.vgo' +} + +vgo { + inputs = fileTree(projectDir) { + include '**/res/drawable*/*.xml' + } + outputs = inputs + showStatistics = true + format = OutputFormat.UNCHANGED + indent = 0 +} +``` + ## Command Line Interface ``` diff --git a/.github/workflows/gradle.yml b/.github/workflows/build.yml similarity index 83% rename from .github/workflows/gradle.yml rename to .github/workflows/build.yml index 0f325dc2..07cb764e 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/build.yml @@ -32,11 +32,6 @@ jobs: with: name: vgo_core_test_results path: vgo-core/build/reports/tests/test/ - - name: archive integration test results - uses: actions/upload-artifact@v1 - with: - name: integration_test_results - path: vgo/build/reports/tests/integrationTest - name: release binary run: ./gradlew binary - name: archive vgo diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..b1193446 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,37 @@ +name: publish + +on: + release: + types: [released] + +jobs: + publish: + name: Release build and publish + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: set up JDK + id: setup-jdk + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Create binary keyring + env: + GPG_KEY_CONTENTS: ${{ secrets.SIGNING_KEY_SECRET }} + SIGNING_KEY_RING_FILE: ${{ secrets.SIGNING_KEY_FILE_PATH }} + run: | + git fetch --unshallow + sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > '$SIGNING_KEY_RING_FILE'" + + - name: Publish to MavenCentral + run: ./gradlew --max-workers 1 --no-daemon publishReleasePublicationToSonatypeRepository closeAndReleaseRepository + env: + SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} + SIGNING_KEY_FILE_PATH: ${{ secrets.SIGNING_KEY_FILE_PATH }} + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + SONATYPE_PROFILE_ID: ${{ secrets.SONATYPE_PROFILE_ID }} \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 55a34cee..72a8a920 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -14,6 +14,7 @@