Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up automatic building #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PoolloverNathan
Copy link

@PoolloverNathan PoolloverNathan commented Feb 7, 2023

This pull request sets up automated compiling and building via Github Actions. The action will create an artifact named "jars" that contains both the distribution jar and the sources jar. To see what the build process looks like, approve this workflow.

This pull request is best suited for rebasing due to only containing a single commit.

Copy link

@Kichura Kichura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but some changes should be considered before hand.

with:
name: jars
path: build/libs
if-no-files-found: error
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be "warn" instead of error because otherwise, it would always assume compilation failed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, but I used error so that if building jars didn't produce any jars, the build would tell you that something is wrong.

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Install Java 17
uses: actions/setup-java@v3.9.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to use ".9.0" in setup-java context.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

uses: actions/setup-java@v3.9.0
with:
java-version: 17 # Can be more specific if neccesary
distribution: adopt
Copy link

@Kichura Kichura Feb 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"temurin" should go here instead of adopt.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- name: Checkout
uses: actions/checkout@v2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this to checkout v3 please.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

This commit adds multiple actions to build.yml that download java 17, build the mod, and upload the jars to Github Actions.
Copy link

@Kichura Kichura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants