-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from wiremock/oleg-nenashev-patch-1
Document release automation with the plugin
- Loading branch information
Showing
1 changed file
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,21 @@ plugins { | |
} | ||
``` | ||
|
||
### Shading | ||
Or in Gradle: | ||
|
||
```groovy | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
} | ||
} | ||
plugins { | ||
id 'org.wiremock.tools.gradle.wiremock-extension-convention' version '0.1.2' | ||
} | ||
``` | ||
|
||
### Shading of dependencies | ||
|
||
When you need to include additional dependencies, | ||
they should be shaded in the `shadedJar` task: | ||
|
@@ -66,6 +80,55 @@ tasks { | |
} | ||
``` | ||
|
||
### Release Automation | ||
|
||
To automate releases with this extension, add the following GitHub action in `.github/workflows/`: | ||
|
||
```yaml | ||
name: Release | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
|
||
- name: Determine new version | ||
id: new_version | ||
run: | | ||
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3) | ||
echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT | ||
- name: Publish package | ||
id: publish_package | ||
uses: gradle/[email protected] | ||
with: | ||
arguments: -Pversion=${{ steps.new_version.outputs.new_version }} publish closeAndReleaseStagingRepository | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} | ||
OSSRH_GPG_SECRET_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }} | ||
OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} | ||
``` | ||
Once the request for [Maven Central Publishing authorization](https://github.com/wiremock/community/blob/main/infra/maven-central.md) is completed, | ||
you can trigger the release Pipeline by just publishing a GitHub Release. | ||
Consider also configuring Release Drafter to automate chaangelogs. | ||
## Usage Examples | ||
- [WireMock Faker Extension](https://github.com/wiremock/wiremock-faker-extension) | ||
|