Skip to content

Commit

Permalink
Merge pull request #8 from wiremock/oleg-nenashev-patch-1
Browse files Browse the repository at this point in the history
Document release automation with the plugin
  • Loading branch information
oleg-nenashev authored Dec 15, 2023
2 parents e470da0 + f3d1886 commit 842ebc3
Showing 1 changed file with 64 additions and 1 deletion.
65 changes: 64 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit 842ebc3

Please sign in to comment.