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

build(ci): migration to github actions #229

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

stachu540
Copy link
Contributor

@stachu540 stachu540 commented Nov 10, 2020

Prerequisites for Code Changes

  • This pull request follows the code style of the project
  • I have tested this feature

Changes Proposed

  • Migration CI/CD to GitHub Actions

Additional Information

This migration contains:

  • ci - which are testing lib in JDK's: 8, 11, 14 and 15 when someone push to some branches and prepare release pushed defined auto-release workflow.
  • release - will monitoring main or master branch in specific schedule and only if the workflow is in this repo
  • pull_request_open - execute actions when Pull Request was opened
  • pull_request_merge - automatically merge Pull Request after all checks are green
  • javadoc - deploy javadoc if release has been published
  • gradle-wrapper - updating gradle wrapper automatically in specific time

Required Secrets

Also there is:

@stachu540 stachu540 marked this pull request as ready for review November 11, 2020 00:14
@stachu540
Copy link
Contributor Author

I can use semantic version using this: https://github.com/marketplace/actions/action-for-semantic-release
rather than release drafter. Action uses Semantic Release as their plugins in this org.

@stachu540 stachu540 marked this pull request as draft January 18, 2021 11:23
* auto-commits each second friday at 10PM GMT
* added configuration file `release.config.js` - see https://github.com/semantic-release/semantic-release

You don't need adding `/slack` into `DISCORD_WEBHOOK` secrets.

Reference `SONATYPE_*` and `GPG_PASSPHRASSE` environments: twitch4j#269
Theoretically should be worked
@stachu540 stachu540 marked this pull request as ready for review February 4, 2021 23:17
@stachu540
Copy link
Contributor Author

GH actions has been ready to review. Some automation will be theoretically worked.

There is more feature has been updated in the description. Feel free to check it out.

auto-merge if there is 2 approves
add javadoc.yml - deploys javadoc to website
PR checks in multiple jobs
release only on 10PM UTC on each second friday
NotLikeThis - will only checks if review is approved
@stachu540
Copy link
Contributor Author

I have update one more time. Now will checks approved reviews. If reviews will be more then 1 it will auto-merge using title as commit message (of course will squash commit).

@stachu540 stachu540 marked this pull request as draft March 28, 2021 21:34
@stachu540
Copy link
Contributor Author

I will temporary stale this PR before testing it myself. After that i will give feedback and pulling some changes in this branch.

- rename release.yml to auto-release.yml
- create release.yml
- update wrapper to 6.8.3
- delete .ci/env
- create gradle-wrapper.yml
- create gradle.properties
- rename and update release.config.js to .releaserc.json
@stachu540 stachu540 marked this pull request as ready for review April 2, 2021 06:06
@stachu540
Copy link
Contributor Author

stachu540 commented Apr 2, 2021

The changes has been applied. Don't know how about the pull request's action. Anything else leaving to review for @PhilippHeuer

All changes has been test in this sandbox You can change configuration, as you like it.

I will rebase it after will be approved.

- commit templates has been created in `.github/release`
- some bit typings and remove scope from pull_request_open.yml
- marking in build.gradle partials, when they needs to update
- refactor should be a major change not a minor
- javadoc moved to release
- release will not rebase to develop
- replace gradle-semantic-release-plugin to @semantic-release/exec to better execute
- final test before release will be inside the semantic-release
- gradle wrapper updates cron
- auto-release updates cron
gradle.properties Outdated Show resolved Hide resolved
don't leave it `unspecified`. `0.0.0-SNAPSHOT` is enough
- `artifactId` in publication is not need - defined by `base.archivesBaseName`
- `group` and `version` defined directly from `gradle.properties`
- reduce `types`
- skip check only form maintainer and @dependabot
- script code correction
Copy link
Member

@iProdigy iProdigy left a comment

Choose a reason for hiding this comment

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

Should explicitly declare artifactId (see: #243 (comment))

Even this change would not be sufficient (e.g. the tmi module would be named twitch4j-tmi, which is better than twitch4j-rest-tmi, but not quite the desired twitch4j-messaginginterface):

archivesBaseName = artifactId.let {
	val prefixCheck = rootProject.artifactId + "-rest-"
	if (it.startsWith(prefixCheck, true))
		rootProject.artifactId + "-" + it.substring(prefixCheck.length)
	else
		it
}

@stachu540
Copy link
Contributor Author

removing rest- in module namings will resolves your request

@iProdigy iProdigy self-requested a review April 29, 2021 15:52
@PhilippHeuer
Copy link
Member

I do prefer to group all the api modules with the rest prefix, but we can't change the artifactId's for already released modules - so that one line in each module to set the artifactId is fine.

@PhilippHeuer
Copy link
Member

I pushed this branch to https://github.com/twitch4j/twitch4j-ghactions-test / main, so we can test the workflows over there.

iProdigy
iProdigy previously approved these changes Apr 30, 2021
@iProdigy iProdigy self-requested a review April 30, 2021 17:02
@PhilippHeuer
Copy link
Member

for the gradle-wrapper workflow:

I added base-branch because it ended up pulling from master/main anyway - it's better to work fully on develop. And i also added the option to manually start the workflow. Example PR here: https://github.com/twitch4j/twitch4j-ghactions-test/pull/28

Next to test will be the MR workflows.

@stachu540
Copy link
Contributor Author

Unfortunate, this action will not have a pull request title definition to when to be a conventional commit. Wish we could do something of that.

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

Successfully merging this pull request may close these issues.

None yet

3 participants