From b8456b3d951ffcfc0cdde2d709b54093ec0125cc Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Fri, 30 Jan 2026 11:49:14 -0700 Subject: [PATCH 1/2] chore: swap makefile for justfile --- .github/workflows/ci.yml | 45 ++++++++++++--------- .github/workflows/publish.yml | 16 ++++---- Makefile | 76 ----------------------------------- README.md | 18 ++++----- justfile | 68 +++++++++++++++++++++++++++++++ 5 files changed, 109 insertions(+), 114 deletions(-) delete mode 100644 Makefile create mode 100644 justfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5a7f05a5..1899a6bf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,14 +11,16 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - javaversion: ["8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25"] + javaversion: + ['8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25'] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 + - uses: extractions/setup-just@v3 - uses: actions/setup-java@v5 with: - distribution: "zulu" - java-version: "25" # Always use the most recent LTS JDK for building - cache: "maven" + distribution: 'zulu' + java-version: '25' # Always use the most recent LTS JDK for building + cache: 'maven' - name: Install dependencies run: make install - name: Build Library @@ -26,20 +28,21 @@ jobs: - name: Set up Java ${{ matrix.javaversion }} uses: actions/setup-java@v5 with: - distribution: "zulu" + distribution: 'zulu' java-version: ${{ matrix.javaversion }} - cache: "maven" + cache: 'maven' - name: Run test with Java ${{ matrix.javaversion }} run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make test-ci coverage: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 + - uses: extractions/setup-just@v3 - uses: actions/setup-java@v5 with: - distribution: "zulu" - java-version: "25" # Always use the most recent LTS JDK for building - cache: "maven" + distribution: 'zulu' + java-version: '25' # Always use the most recent LTS JDK for building + cache: 'maven' - name: Install dependencies run: make install - name: Test coverage @@ -58,16 +61,17 @@ jobs: uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: "./coverage.lcov" + path-to-lcov: './coverage.lcov' lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 + - uses: extractions/setup-just@v3 - uses: actions/setup-java@v5 with: - distribution: "zulu" - java-version: "25" # Always use the most recent LTS JDK for building - cache: "maven" + distribution: 'zulu' + java-version: '25' # Always use the most recent LTS JDK for building + cache: 'maven' - name: Install checkstyle and style guide run: make install-checkstyle - name: Lint @@ -81,12 +85,13 @@ jobs: if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 + - uses: extractions/setup-just@v3 - uses: actions/setup-java@v5 with: - distribution: "zulu" - java-version: "25" # Always use the most recent LTS JDK for building - cache: "maven" + distribution: 'zulu' + java-version: '25' # Always use the most recent LTS JDK for building + cache: 'maven' - name: Install Dependencies run: make install - name: Generate Docs diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4a03556d7..5c71a712e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,17 +27,15 @@ jobs: release: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 - - - name: Install JDK - uses: actions/setup-java@v4 + - uses: extractions/setup-just@v3 + - uses: actions/setup-java@v5 with: - distribution: "zulu" - java-version: "25" # Always use the most recent LTS JDK for building - server-id: "ossrh" + distribution: 'zulu' + java-version: '25' # Always use the most recent LTS JDK for building + server-id: 'ossrh' # define environmental variable names server-username: MAVEN_USERNAME server-password: MAVEN_CENTRAL_TOKEN @@ -54,5 +52,5 @@ jobs: - name: Upload output files to release uses: AButler/upload-release-assets@v3.0.1 with: - files: "target/*.jar;target/*.pom;target/*.asc" + files: 'target/*.jar;target/*.pom;target/*.asc' repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile deleted file mode 100644 index ef47adf6f..000000000 --- a/Makefile +++ /dev/null @@ -1,76 +0,0 @@ -## help - Display help about make targets for this Makefile -help: - @cat Makefile | grep '^## ' --color=never | cut -c4- | sed -e "`printf 's/ - /\t- /;'`" | column -s "`printf '\t'`" -t - -## build - Builds the project for development -build: - mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true - -## clean - Cleans the project -clean: - mvn clean - -## coverage - Test (and build) the project to generate a coverage report -coverage: - mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report - -## checkstyle - Check if project follows CheckStyle rules (must run install-checkstyle first) -checkstyle: - java -jar checkstyle.jar src -c examples/style_guides/java/easypost_java_style.xml -d - -## docs - Generates library documentation -docs: - mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djacoco.skip=true - cp -R target/reports/apidocs/ ./docs/ - -## install-checkstyle - Install the Checkstyle tool (Unix only) -install-checkstyle: | install-styleguide - curl -LJs https://github.com/checkstyle/checkstyle/releases/download/checkstyle-10.3.1/checkstyle-10.3.1-all.jar -o checkstyle.jar - -## install-styleguide - Install style guides -install-styleguide: | init-examples-submodule - sh examples/symlink_directory_files.sh examples/style_guides/java . - -## init-examples-submodule - Initialize the examples submodule -init-examples-submodule: - git submodule init - git submodule update - -## install - Install requirements -install: | install-checkstyle - -## lint - Lints the project -lint: checkstyle - -## publish - Publish a release of the project (will build the project via the `mvn deploy` command) -# @parameters: -# pass= - The GPG password to sign the release -publish: - mvn clean deploy -Dgpg.passphrase=${pass} - -## publish-dry - Build the project as a dry run to publishing (will build the project via the `mvn install` command) -# @parameters: -# pass= - The GPG password to sign the release -publish-dry: - mvn clean install -Dgpg.passphrase=${pass} - -## release - Cuts a release for the project on GitHub (requires GitHub CLI) -# tag = The associated tag title of the release -# target = Target branch or full commit SHA -release: - gh release create ${tag} target/*.jar target/*.asc target/*.pom --target ${target} - -## test - Test the project -test: - mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true - -## test-ci - Test the project on CI (does not rebuild the project) -test-ci: - mvn surefire:test - -## update-examples-submodule - Update the examples submodule -update-examples-submodule: - git submodule init - git submodule update --remote - -.PHONY: help build clean coverage docs install-checkstyle install-styleguide install lint publish publish-dry release test test-ci update-examples-submodule diff --git a/README.md b/README.md index 52000eba4..05ecd327b 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ Users can subscribe to HTTP requests and responses via the `RequestHook` and `Re API documentation can be found at: . -Library documentation can be found on the web at: or by building them locally via the `make docs` command. +Library documentation can be found on the web at: or by building them locally via the `just docs` command. Upgrading major versions of this project? Refer to the [Upgrade Guide](UPGRADE_GUIDE.md). @@ -135,26 +135,26 @@ For additional support, see our [org-wide support policy](https://github.com/Eas ```bash # Install dependencies -make install +just install # Build project -make build +just build # Lint project -make lint +just lint # Run tests -EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make build test -EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make coverage +EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just build test +EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just coverage # Run security analysis -make scan +just scan # Generate library documentation -make docs +just docs # Update submodules -make update-examples-submodule +just update-examples-submodule ``` ### Testing diff --git a/justfile b/justfile new file mode 100644 index 000000000..591f8d820 --- /dev/null +++ b/justfile @@ -0,0 +1,68 @@ +## Builds the project for development +build: + mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true + +## Cleans the project +clean: + mvn clean + +## Test (and build) the project to generate a coverage report +coverage: + mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report + +## Check if project follows CheckStyle rules (must run install-checkstyle first) +checkstyle: + java -jar checkstyle.jar src -c examples/style_guides/java/easypost_java_style.xml -d + +## Generates library documentation +docs: + mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djacoco.skip=true + cp -R target/reports/apidocs/ ./docs/ + +## Install the Checkstyle tool (Unix only) +install-checkstyle: install-styleguide + curl -LJs https://github.com/checkstyle/checkstyle/releases/download/checkstyle-10.3.1/checkstyle-10.3.1-all.jar -o checkstyle.jar + +## Install style guides +install-styleguide: init-examples-submodule + sh examples/symlink_directory_files.sh examples/style_guides/java . + +## Initialize the examples submodule +init-examples-submodule: + git submodule init + git submodule update + +## Install requirements +install: install-checkstyle + +## Lints the project +lint: checkstyle + +## Publish a release of the project (will build the project via the `mvn deploy` command) +# pass= - The GPG password to sign the release +publish pass: + mvn clean deploy -Dgpg.passphrase={{pass}} + +## Build the project as a dry run to publishing (will build the project via the `mvn install` command) +# pass= - The GPG password to sign the release +publish-dry pass: + mvn clean install -Dgpg.passphrase={{pass}} + +## Cuts a release for the project on GitHub (requires GitHub CLI) +# tag = The associated tag title of the release +# target = Target branch or full commit SHA +release tag target: + gh release create {{tag}} target/*.jar target/*.asc target/*.pom --target {{target}} + +## Test the project +test: + mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true + +## Test the project on CI (does not rebuild the project) +test-ci: + mvn surefire:test + +## Update the examples submodule +update-examples-submodule: + git submodule init + git submodule update --remote From 05dd153d29d99d5004c2693439a64a17230d71e8 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Fri, 30 Jan 2026 11:52:24 -0700 Subject: [PATCH 2/2] fix: correct just references in CI --- .github/workflows/ci.yml | 18 +++++++++--------- .github/workflows/publish.yml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1899a6bf4..0a03926db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,9 +22,9 @@ jobs: java-version: '25' # Always use the most recent LTS JDK for building cache: 'maven' - name: Install dependencies - run: make install + run: just install - name: Build Library - run: make build + run: just build - name: Set up Java ${{ matrix.javaversion }} uses: actions/setup-java@v5 with: @@ -32,7 +32,7 @@ jobs: java-version: ${{ matrix.javaversion }} cache: 'maven' - name: Run test with Java ${{ matrix.javaversion }} - run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make test-ci + run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just test-ci coverage: runs-on: ubuntu-latest steps: @@ -44,9 +44,9 @@ jobs: java-version: '25' # Always use the most recent LTS JDK for building cache: 'maven' - name: Install dependencies - run: make install + run: just install - name: Test coverage - run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make coverage + run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just coverage - name: Load Rust cache if: github.ref == 'refs/heads/master' uses: Swatinem/rust-cache@v2 @@ -73,9 +73,9 @@ jobs: java-version: '25' # Always use the most recent LTS JDK for building cache: 'maven' - name: Install checkstyle and style guide - run: make install-checkstyle + run: just install-checkstyle - name: Lint - run: make lint + run: just lint - name: Upload Test results uses: actions/upload-artifact@master with: @@ -93,9 +93,9 @@ jobs: java-version: '25' # Always use the most recent LTS JDK for building cache: 'maven' - name: Install Dependencies - run: make install + run: just install - name: Generate Docs - run: make docs + run: just docs - name: Deploy docs uses: peaceiris/actions-gh-pages@v3 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5c71a712e..62401a45f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -43,7 +43,7 @@ jobs: 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 }} + run: just install-styleguide publish pass=${{ secrets.MAVEN_GPG_PASSPHRASE }} env: MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}