Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed to deploy to Maven Central #367

Merged
merged 1 commit into from
Aug 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/scripts/build.sh

This file was deleted.

12 changes: 0 additions & 12 deletions .github/scripts/deploy.sh

This file was deleted.

35 changes: 13 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,19 @@ on:
push:
branches:
- main
env:
JAVA_TOOL_OPTIONS: >-
-XX:TieredStopAtLevel=1
-XX:+UseParallelGC
-Dstyle.color=always
-Djansi.force=true

jobs:
build:
name: Maven build
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Maven
run: .github/scripts/build.sh
- name: Code coverage report
uses: codecov/codecov-action@v3
name: Build
uses: gantsign/workflows/.github/workflows/maven-build.yml@v1
with:
java-version: '11'

deploy:
name: Deploy
needs: build
if: github.repository == 'gantsign/kotlin-maven-plugin-tools'
uses: gantsign/workflows/.github/workflows/maven-deploy.yml@v1
with:
java-version: '11'
secrets: inherit
59 changes: 10 additions & 49 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,19 @@ on:
release:
types:
- published
env:
JAVA_TOOL_OPTIONS: >-
-XX:TieredStopAtLevel=1
-XX:+UseParallelGC
-Dstyle.color=always
-Djansi.force=true

jobs:
build:
name: Maven build
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Maven
run: .github/scripts/build.sh
- name: Code coverage report
uses: codecov/codecov-action@v3
name: Build
uses: gantsign/workflows/.github/workflows/maven-build.yml@v1
with:
java-version: '11'

deploy:
name: Maven deploy
runs-on: ubuntu-20.04
name: Deploy
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Install GPG key
run: |-
gpg --batch --import-options import-show --import << EOF
${{ secrets.GPG_KEY }}
EOF
- name: Deploy with Maven
run: .github/scripts/deploy.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Delete GPG secret key
if: ${{ always() }}
run: gpg --batch --yes --delete-secret-keys ${{ secrets.GPG_KEY_NAME }} || true
- name: Delete GPG public key
if: ${{ always() }}
run: gpg --batch --yes --delete-keys ${{ secrets.GPG_KEY_NAME }}
if: github.repository == 'gantsign/kotlin-maven-plugin-tools'
uses: gantsign/workflows/.github/workflows/maven-deploy.yml@v1
with:
java-version: '11'
secrets: inherit
27 changes: 4 additions & 23 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,9 @@ name: Verify
on:
pull_request: {}

env:
JAVA_TOOL_OPTIONS: >-
-XX:TieredStopAtLevel=1
-XX:+UseParallelGC
-Dstyle.color=always
-Djansi.force=true

jobs:
build:
name: Maven build
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Maven
run: .github/scripts/build.sh
- name: Code coverage report
uses: codecov/codecov-action@v3
name: Build
uses: gantsign/workflows/.github/workflows/maven-build.yml@v1
with:
java-version: '11'
58 changes: 1 addition & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Kotlin Maven Plugin Tools

[![Release](https://github.com/gantsign/kotlin-maven-plugin-tools/workflows/Build/badge.svg)](https://github.com/gantsign/kotlin-maven-plugin-tools/actions?query=workflow%3ABuild)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.gantsign.maven.plugin-tools/kotlin-maven-plugin-tools/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.gantsign.maven.plugin-tools/kotlin-maven-plugin-tools)
[![codecov](https://codecov.io/gh/gantsign/kotlin-maven-plugin-tools/branch/main/graph/badge.svg)](https://codecov.io/gh/gantsign/kotlin-maven-plugin-tools)
[![Known Vulnerabilities](https://snyk.io/test/github/gantsign/kotlin-maven-plugin-tools/badge.svg)](https://snyk.io/test/github/gantsign/kotlin-maven-plugin-tools)

Maven plugin metadata extractor for plugins written in Kotlin.

**Note:** this JAR isn't available from Maven Central, see below for how to
configure a `pluginRepository` to download the JAR from GitHub Packages.

**This project is still a little new, so please help by reporting any issues you find.**

## Maven plugin support for Kotlin
Expand Down Expand Up @@ -195,64 +193,10 @@ Your POM will include the following:
</executions>
</plugin>
</plugins>

</build>

<!--
kotlin-maven-plugin-tools isn't available from Maven Central, so you
have to add the following plugin repository.
Where possible you you should use a repository manager rather than adding
the repository directly to your POM.
-->
<pluginRepositories>
<pluginRepository>
<!-- id must match the id of the server in settings.xml -->
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/gantsign/kotlin-maven-plugin-tools</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

</project>
```

GitHub Packages repositories require authentication, so you need to specify the
credentials in your `settings.xml`. You don't need particular permissions, any
valid GitHub account token will do.

```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<!-- This is setup for you if using id "github" with
https://github.com/actions/setup-java -->
<!-- id must match the id of the pluginRepository -->
<id>github</id>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>

</settings>
```

If using GitHub Actions, you also need to pass the `GITHUB_TOKEN` environment
variable to the build step(s) in your workflow file e.g.:

```yaml
- name: Build with Maven
run: mvn install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

License
-------

Expand Down