From 8ee661214942a441274000ad04595d2ff528e53c Mon Sep 17 00:00:00 2001 From: Nate Harris Date: Mon, 30 Sep 2024 13:50:47 -0600 Subject: [PATCH] [chore] Prep v0.5.3 release, auto-release process (#31) - Add Actions-based release process - Bump version number --- .github/workflows/ci.yml | 46 ++++++++++++++++----------- .github/workflows/publish.yml | 58 +++++++++++++++++++++++++++++++++++ CHANGELOG.md | 2 +- README.md | 4 +-- VERSION | 2 +- pom.xml | 2 +- 6 files changed, 91 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5850da..81905a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,12 +8,17 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: - java_version: [ "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19" ] + java_version: [ "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23" ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Set up JDK for compilation + uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: "23" # Always use the latest JDK for building - name: Load Maven dependencies cache uses: actions/cache@v3 with: @@ -23,11 +28,6 @@ jobs: ${{ runner.os }}-maven- - name: Install dependencies run: make install - - name: Set up JDK for compilation - uses: actions/setup-java@v3 - with: - distribution: "zulu" - java-version: "19" # Always use the latest JDK for building - name: Compile run: make build - name: Set up Java ${{ matrix.java_version }} @@ -38,16 +38,16 @@ jobs: - name: Run test with Java ${{ matrix.java_version }} run: make test coverage: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Install dependencies - run: make install + - uses: actions/checkout@v4 - name: Set up JDK for compilation - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: "zulu" - java-version: "19" # Always use the latest JDK for building + java-version: "23" # Always use the latest JDK for building + - name: Install dependencies + run: make install - name: Test coverage run: make coverage - name: Load Rust cache @@ -66,9 +66,14 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: "./coverage.lcov" lint: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Set up JDK for compilation + uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: "23" # Always use the latest JDK for building - name: Run CheckStyle checks uses: nikitasavinov/checkstyle-action@0.5.1 with: @@ -77,9 +82,14 @@ jobs: checkstyle_config: easypost_java_style.xml tool_name: "style_enforcer" security: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Set up JDK for compilation + uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: "23" # Always use the latest JDK for building - name: Load Maven dependencies and CVE database cache uses: actions/cache@v3 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..f5edeb3 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,58 @@ +# This workflow will build a Java project with Maven and publish it to Maven Central Repository +# ref: https://github.com/actions/setup-java/blob/v3.11.0/docs/advanced-usage.md#Publishing-using-Apache-Maven + +# Secrets required: +# - MAVEN_USERNAME: Username for Maven Central Repository +# - MAVEN_CENTRAL_TOKEN: Token/password for Maven Central Repository +# - MAVEN_GPG_PRIVATE_KEY: GPG private key to sign the artifacts (string) +# - MAVEN_GPG_PASSPHRASE: Passphrase for the GPG private key + +name: Publish library to Maven Central Repository + +on: + release: + types: [created] + secrets: + MAVEN_USERNAME: + required: true + MAVEN_CENTRAL_TOKEN: + required: true + MAVEN_GPG_PRIVATE_KEY: + required: true + MAVEN_GPG_PASSPHRASE: + required: true + workflow_dispatch: ~ + +jobs: + release: + runs-on: ubuntu-20.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install JDK + uses: actions/setup-java@v3 + with: + distribution: "zulu" + java-version: "23" # Always use the latest JDK + server-id: "ossrh" + # define environmental variable names + server-username: MAVEN_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + + - name: Clean, build and publish to Apache Maven Central + run: make install-styleguide publish pass=${{ secrets.MAVEN_GPG_PASSPHRASE }} + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + + - name: Upload output files to release + uses: AButler/upload-release-assets@v3.0 + with: + files: "target/*.jar;target/*.pom;target/*.asc" + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 5be2216..fbbce17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # CHANGELOG -## Next Release +## v0.5.3 (2024-09-24) - New `byCustomRule` function to allow users to define their own matching rule when finding a matching interaction in a cassette - Improve error messages when a matching interaction is not found (human-readable error messages) diff --git a/README.md b/README.md index 7af4942..e3c6094 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Add this to your project's POM: com.easypost easyvcr - 0.5.2 + 0.5.3 ``` @@ -27,7 +27,7 @@ Add this to your project's POM: Add this to your project's build file: ```groovy -implementation "com.easypost:easyvcr:0.5.2" +implementation "com.easypost:easyvcr:0.5.3" ``` ## Supported HTTP Clients diff --git a/VERSION b/VERSION index cb0c939..be14282 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.2 +0.5.3 diff --git a/pom.xml b/pom.xml index e206042..f563f99 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.easypost easyvcr - 0.5.2 + 0.5.3 jar com.easypost:easyvcr