-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: added workflows, updated subprojects gradle builds
- Loading branch information
1 parent
54c2e18
commit 4c5f1db
Showing
8 changed files
with
240 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Build on every push | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
|
||
|
||
jobs: | ||
build: | ||
name: "Build" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Calculate release version | ||
run: | | ||
echo "release_version=1.$(date +'%g%m%d%H%M').$(echo ${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV | ||
- name: Set version | ||
run: | | ||
sed -i "s/1.SNAPSHOT/${{ env.release_version }}/g" build.gradle.kts Values.kt | ||
- run: | | ||
git tag v${{ env.release_version }} | ||
git push --tags | ||
- name: Setup java | ||
uses: actions/[email protected] | ||
with: | ||
distribution: 'adopt-hotspot' | ||
java-version: '15' | ||
- name: Setup cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Gradle wrapper validation | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Running gradle build | ||
uses: eskatos/[email protected] | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | ||
with: | ||
arguments: build publish --no-daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: "Lint PR" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
main: | ||
name: Validate PR | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: walt-id/commitlint-github-action@v4 | ||
with: | ||
noMerges: true | ||
id: lint_commit_messages | ||
continue-on-error: true | ||
- name: semantic-pull-request | ||
if: always() && !contains(fromJSON(steps.lint_commit_messages.outputs.results).*.valid, true) | ||
id: lint_pr_title | ||
uses: amannn/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: marocchino/sticky-pull-request-comment@v2 | ||
# When the previous steps fails, the workflow would stop. By adding this | ||
# condition you can continue the execution with the populated error message. | ||
if: always() && (steps.lint_pr_title.outputs.error_message != null || contains(fromJSON(steps.lint_commit_messages.outputs.results).*.valid, false)) | ||
with: | ||
header: pr-title-lint-error | ||
message: | | ||
Hey there and thank you for opening this pull request! 👋🏼 | ||
Some or all of your commit messages do not seem to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). | ||
To allow the merge of this pull request, we require that at least one commit message <b>or</b> the PR title follow that convention. | ||
You have the <b>following possibilities to proceed</b> with this PR: | ||
1) Make sure at least one commit message complies with the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). | ||
Note, if not all messages comply, the merge will be allowed, but you will still see this warning. | ||
2) Update the title of this pull request to comply with the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). | ||
<b>Further information:</b> | ||
The commit messages and PR title will be parsed according to the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/), to automatically populate the release notes for the next official release. | ||
Therefore, make sure the commit messages <b>or</b> PR title contain the necessary and relevant information describing the changes of this pull request. | ||
<b>Commit message details:</b> | ||
``` | ||
${{ toJSON(fromJSON(steps.lint_commit_messages.outputs.results)) }} | ||
``` | ||
<b>PR title details:</b> | ||
``` | ||
${{ steps.lint_pr_title.outputs.error_message }} | ||
``` | ||
# Delete a previous comment when the issue has been resolved | ||
- if: ${{ steps.lint_pr_title.outputs.error_message == null && !contains(fromJSON(steps.lint_commit_messages.outputs.results).*.valid, false) }} | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: pr-title-lint-error | ||
delete: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Release on push to main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: "Release" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Calculate release version | ||
run: | | ||
echo "release_version=1.$(date +'%g%m%d%H%M').0" >> $GITHUB_ENV | ||
- name: Set version | ||
run: | | ||
sed -i "s/1.SNAPSHOT/${{ env.release_version }}/g" build.gradle.kts src/main/kotlin/id/walt/Values.kt | ||
- run: | | ||
git tag v${{ env.release_version }} | ||
git push --tags | ||
- name: Setup cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Gradle wrapper validation | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Running gradle build | ||
uses: eskatos/[email protected] | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | ||
with: | ||
arguments: build publish --no-daemon | ||
- name: Changelog | ||
uses: ardalanamini/auto-changelog@v3 | ||
id: changelog | ||
with: | ||
github-token: ${{ github.token }} | ||
commit-types: | | ||
breaking: Breaking Changes | ||
feat: New Features | ||
fix: Bug Fixes | ||
revert: Reverts | ||
perf: Performance Improvements | ||
refactor: Refactors | ||
deps: Dependencies | ||
docs: Documentation Changes | ||
style: Code Style Changes | ||
build: Build System | ||
ci: Continuous Integration | ||
test: Tests | ||
chore: Chores | ||
other: Other Changes | ||
default-commit-type: Other Changes | ||
release-name: v${{ env.release_version }} | ||
mention-authors: true | ||
mention-new-contributors: true | ||
include-compare: true | ||
semver: true | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ env.release_version }} | ||
body: | | ||
${{ steps.changelog.outputs.changelog }} | ||
prerelease: ${{ steps.changelog.outputs.prerelease }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: 'Close stale issues and PRs' | ||
on: | ||
schedule: | ||
- cron: '30 20 * * *' | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v3 | ||
with: | ||
stale-issue-message: 'This issue has been marked as stale.' | ||
stale-pr-message: 'This pull request has been marked as stale.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters