Skip to content

Commit 406f649

Browse files
committed
- Port updated Makefile steps from Java client library to fix CI
1 parent db1fa2f commit 406f649

File tree

2 files changed

+37
-17
lines changed

2 files changed

+37
-17
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
4646

4747
- name: Clean, build and publish to Apache Maven Central
48-
run: make install publish pass=${{ secrets.MAVEN_GPG_PASSPHRASE }}
48+
run: make install-styleguide publish pass=${{ secrets.MAVEN_GPG_PASSPHRASE }}
4949
env:
5050
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
5151
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}

Makefile

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,73 @@ help:
44

55
## build - Builds the project for development
66
build:
7-
mvn clean install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true
7+
mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true
88

99
## clean - Cleans the project
1010
clean:
1111
mvn clean
1212

13-
## coverage - Test the project and generate a coverage report
13+
## coverage - Test (and build) the project to generate a coverage report
1414
coverage:
15-
mvn --batch-mode install -Dgpg.skip=true -Dcheckstyle.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report
15+
mvn verify -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report
1616

17-
## install-checkstyle - Install CheckStyle
18-
install-checkstyle:
17+
## checkstyle - Check if project follows CheckStyle rules (must run install-checkstyle first)
18+
checkstyle:
19+
java -jar checkstyle.jar src -c examples/style_guides/java/easypost_java_style.xml -d
20+
21+
## docs - Generates library documentation
22+
docs:
23+
mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djacoco.skip=true
24+
cp -R target/apidocs/ ./docs/
25+
26+
## install-checkstyle - Install the Checkstyle tool (Unix only)
27+
install-checkstyle: | install-styleguide
1928
curl -LJs https://github.com/checkstyle/checkstyle/releases/download/checkstyle-10.3.1/checkstyle-10.3.1-all.jar -o checkstyle.jar
20-
curl -LJs https://raw.githubusercontent.com/EasyPost/easypost-java/master/easypost_java_style.xml -o easypost_java_style.xml
2129

22-
## install - Install requirements
23-
install: | install-checkstyle
30+
## install-styleguide - Install style guides
31+
install-styleguide: | init-examples-submodule
32+
sh examples/symlink_directory_files.sh examples/style_guides/java .
33+
34+
## init-examples-submodule - Initialize the examples submodule
35+
init-examples-submodule:
2436
git submodule init
2537
git submodule update
2638

27-
## lint - Check if project follows CheckStyle rules (must run install-checkstyle first)
28-
lint:
29-
java -jar checkstyle.jar src -c easypost_java_style.xml -d
39+
## install - Install requirements
40+
install: | install-checkstyle
41+
42+
## lint - Lints the project
43+
lint: checkstyle scan
3044

31-
## publish - Publish a release of the project
45+
## publish - Publish a release of the project (will build the project via the `mvn deploy` command)
3246
# @parameters:
3347
# pass= - The GPG password to sign the release
3448
publish:
3549
mvn clean deploy -Dgpg.passphrase=${pass}
3650

37-
## publish-dry - Build the project as a dry run to publishing
51+
## publish-dry - Build the project as a dry run to publishing (will build the project via the `mvn install` command)
3852
# @parameters:
3953
# pass= - The GPG password to sign the release
4054
publish-dry:
4155
mvn clean install -Dgpg.passphrase=${pass}
4256

4357
## release - Cuts a release for the project on GitHub (requires GitHub CLI)
4458
# tag = The associated tag title of the release
59+
# target = Target branch or full commit SHA
4560
release:
46-
gh release create ${tag} target/*.jar target/*.asc target/*.pom
61+
gh release create ${tag} target/*.jar target/*.asc target/*.pom --target ${target}
4762

4863
## scan - Scan the project for serious security issues
4964
scan:
50-
mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0
65+
mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Djacoco.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0
5166

5267
## test - Test the project
5368
test:
5469
mvn surefire:test
5570

56-
.PHONY: help build clean coverage install-checkstyle install lint publish publish-dry release scan test
71+
## update-examples-submodule - Update the examples submodule
72+
update-examples-submodule:
73+
git submodule init
74+
git submodule update --remote
75+
76+
.PHONY: help build clean coverage docs install-checkstyle install-styleguide install lint publish publish-dry release scan scan-strict test update-examples-submodule

0 commit comments

Comments
 (0)