Skip to content

Commit

Permalink
Merge to master (#20)
Browse files Browse the repository at this point in the history
* Update README.md

* Improve GHA and usual repository boilerplate (#12)

Refactoring GHA for code quality

* Repository cleanup (#19)

* Delete unnecessary files

* Setup multi modular gradle project properly

* Rename GUILD.md to README.md

* Run Spotless on all files

* Update Spring plugin to latest for Java 21 support

* Create pre-commit.yaml GHA

* Use .yaml for Spring properties

* Packaged JShellWrapper

* Add docker-compose.yaml

* Update README.md

---------

Co-authored-by: Alathreon <45936420+Alathreon@users.noreply.github.com>
Co-authored-by: Suraj Kumar <suraj.kumar@digital.cabinet-office.gov.uk>
Co-authored-by: Suraj Kumar <sk96.uk@gmail.com>
  • Loading branch information
4 people authored May 19, 2024
1 parent dfd06a1 commit 1a41fc8
Show file tree
Hide file tree
Showing 74 changed files with 903 additions and 1,101 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"
26 changes: 26 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[contributing]: https://github.com/Together-Java/TJ-Bot/wiki/Contributing
[code_guidelines]: https://github.com/Together-Java/TJ-Bot/wiki/Code-Guidelines
[new_issue]: https://github.com/Together-Java/TJ-Bot/issues/new/choose

## Pull-request

- [ ] I have read the [contributing guidelines][contributing].
- [ ] I have read the [code guidelines][code_guidelines].
- [ ] I have created a relating [issue][new_issue].

### Changes

- [ ] Existing code
- [ ] New feature

<!--
While an issue isn't required, this is preferred for most changes.
It helps make it maintainable for us, and will save you from possibly recoding everything :p
If there's no relating issue, keep it NaN
-->

Closes Issue: NaN

## Description

Replace this sentence with general description of what your Pull Request does.
33 changes: 14 additions & 19 deletions .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,28 @@ name: Docker Publish

on:
push:
branches:
- 'master'
- 'feature/cicd-workflows'

env:
JAVA_VERSION: 19
branches: [ master ]
workflow_dispatch:

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- uses: actions/checkout@v2
- name: Check out code
uses: actions/checkout@v4

- name: Install Java
uses: actions/setup-java@v3
with:
fetch-depth: 0
- name: Build and Publish Docker Image
java-version: '21'
distribution: 'corretto'

- name: Build Docker image and publish
env:
ORG_REGISTRY_USER: ${{ secrets.ORG_REGISTRY_USER }}
ORG_REGISTRY_PASSWORD: ${{ secrets.ORG_REGISTRY_PASSWORD }}
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
BRANCH_NAME: ${{ github.ref_name }}
run: ./gradlew jib
- name: Re-Deploy

- name: Trigger deployment
run: "curl -H 'Authorization: Bearer ${{ secrets.ORG_WATCHTOWER_TOKEN }}' https://togetherjava.org:5003/v1/update"
24 changes: 12 additions & 12 deletions .github/workflows/docker-verify.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: Docker Verify

on: [pull_request]

env:
JAVA_VERSION: 19
on:
pull_request:
workflow_dispatch:

jobs:
docker:
name: Docker Verify
runs-on: ubuntu-latest
steps:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
- uses: actions/checkout@v2
- name: Check out code
uses: actions/checkout@v4

- name: Install Java
uses: actions/setup-java@v3
with:
fetch-depth: 0
- name: Docker Verify
java-version: 21
distribution: 'corretto'

- name: Build Docker image
run: ./gradlew jibDockerBuild
22 changes: 22 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: pre-commit
on:
pull_request:
workflow_dispatch:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'corretto'

- uses: gradle/gradle-build-action@v3
with:
gradle-version: 8.7

- name: Build with Gradle
run: gradle build
21 changes: 10 additions & 11 deletions .github/workflows/releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,27 @@ defaults:
run:
shell: bash

env:
JAVA_VERSION: 19

jobs:

release:
name: Build and release
runs-on: ubuntu-latest
steps:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
- name: Check out code
uses: actions/checkout@v4

- uses: actions/checkout@v2
- name: Install Java
uses: actions/setup-java@v3
with:
java-version: 21
distribution: 'corretto'

- name: Build shadow jar
- name: Generate FAT Jar
run: ./gradlew shadowJar

- name: Create release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: app/build/libs/TJ-Plays.jar
files: app/build/libs/TJ-JShell-Backend.jar
2 changes: 0 additions & 2 deletions BuildImage.bat

This file was deleted.

3 changes: 0 additions & 3 deletions BuildImage.sh

This file was deleted.

6 changes: 0 additions & 6 deletions BuildJShellWrapper.bat

This file was deleted.

8 changes: 0 additions & 8 deletions BuildJShellWrapper.sh

This file was deleted.

3 changes: 0 additions & 3 deletions Dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion Insomnia_2023-01-09.json

This file was deleted.

Loading

0 comments on commit 1a41fc8

Please sign in to comment.