Skip to content

Commit

Permalink
Revert "Improve GHA and usual repository boilerplate (#12)"
Browse files Browse the repository at this point in the history
This reverts commit 3f4bd23.
  • Loading branch information
tj-wazei authored May 19, 2024
1 parent 3f4bd23 commit e884315
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 78 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

6 changes: 0 additions & 6 deletions .github/dependabot.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/pull_request_template.md

This file was deleted.

33 changes: 19 additions & 14 deletions .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,33 @@ name: Docker Publish

on:
push:
branches: [ master ]
workflow_dispatch:
branches:
- 'master'
- 'feature/cicd-workflows'

env:
JAVA_VERSION: 19

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Install Java
uses: actions/setup-java@v3
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '21'
distribution: 'corretto'

- name: Build Docker image and publish
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
with:
fetch-depth: 0
- name: Build and Publish Docker Image
env:
ORG_REGISTRY_USER: ${{ secrets.ORG_REGISTRY_USER }}
ORG_REGISTRY_PASSWORD: ${{ secrets.ORG_REGISTRY_PASSWORD }}
BRANCH_NAME: ${{ github.ref_name }}
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
run: ./gradlew jib

- name: Trigger deployment
- name: Re-Deploy
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:
workflow_dispatch:

on: [pull_request]

env:
JAVA_VERSION: 19

jobs:
docker:
name: Docker Verify
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Install Java
uses: actions/setup-java@v3
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 21
distribution: 'corretto'

- name: Build Docker image
java-version: ${{ env.JAVA_VERSION }}
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Docker Verify
run: ./gradlew jibDockerBuild
21 changes: 11 additions & 10 deletions .github/workflows/releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,28 @@ defaults:
run:
shell: bash

env:
JAVA_VERSION: 19

jobs:

release:
name: Build and release
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Install Java
uses: actions/setup-java@v3
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 21
distribution: 'corretto'
java-version: ${{ env.JAVA_VERSION }}

- uses: actions/checkout@v2

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

- name: Create release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: app/build/libs/TJ-JShell-Backend.jar
files: app/build/libs/TJ-Plays.jar
1 change: 1 addition & 0 deletions Insomnia_2023-01-09.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"_type":"export","__export_format":4,"__export_date":"2023-01-09T22:20:32.207Z","__export_source":"insomnia.desktop.app:v2022.6.0","resources":[{"_id":"req_72d292af436943f3acc7811cd6cda651","parentId":"wrk_9201930bce444ac8a852dd54cbf5cafc","modified":1673302718265,"created":1673298082010,"url":"{{ _.baseUrl }}jshell/eval/864","name":"Eval","description":"","method":"POST","body":{"mimeType":"","text":"for(int i = 5; i < 10; i++) {\n\tSystem.out.println(i);\n}"},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1673298082010,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_9201930bce444ac8a852dd54cbf5cafc","parentId":null,"modified":1673298071281,"created":1673298071281,"name":"JShellPlaygroundBackend.yaml","description":"","scope":"design","_type":"workspace"},{"_id":"req_5800c720bc6d42279f10920f0f810d0b","parentId":"wrk_9201930bce444ac8a852dd54cbf5cafc","modified":1673300342786,"created":1673300127045,"url":"{{ _.baseUrl }}jshell/eval","name":"Eval no id","description":"","method":"POST","body":{"mimeType":"","text":"for(int i = 5; i < 10; i++) {\n\tSystem.out.println(i);\n}"},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1671284625665.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_7a9147556dca485581f6a49be54cc47e","parentId":"wrk_9201930bce444ac8a852dd54cbf5cafc","modified":1673300143893,"created":1673300097575,"url":"{{ _.baseUrl }}jshell/snippets/864","name":"Snippets","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1669271169321,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_a3af52aad2ef48a7b48136bea956803d","parentId":"wrk_9201930bce444ac8a852dd54cbf5cafc","modified":1673300226219,"created":1673300163253,"url":"{{ _.baseUrl }}jshell/864","name":"Delete","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1667257712976.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_3aab86b18a10af8cac406990d3f05953859c65da","parentId":"wrk_9201930bce444ac8a852dd54cbf5cafc","modified":1673298222338,"created":1673298071287,"name":"Base Environment","data":{},"dataPropertyOrder":{},"color":null,"isPrivate":false,"metaSortKey":1673298071287,"_type":"environment"},{"_id":"jar_3aab86b18a10af8cac406990d3f05953859c65da","parentId":"wrk_9201930bce444ac8a852dd54cbf5cafc","modified":1673298071288,"created":1673298071288,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"spc_2730c97ce76e44e99faa9ab3320038d5","parentId":"wrk_9201930bce444ac8a852dd54cbf5cafc","modified":1673298071283,"created":1673298071283,"fileName":"JShellPlaygroundBackend.yaml","contents":"","contentType":"yaml","_type":"api_spec"},{"_id":"env_0533b109f389443daa97bb05c73e7502","parentId":"env_3aab86b18a10af8cac406990d3f05953859c65da","modified":1673298277963,"created":1673298227299,"name":"Localhost","data":{"baseUrl":"http://localhost:8080/"},"dataPropertyOrder":{"&":["baseUrl"]},"color":null,"isPrivate":false,"metaSortKey":1673298227299,"_type":"environment"}]}
8 changes: 7 additions & 1 deletion JShellAPI/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ plugins {
group 'org.togetherjava'
version '1.0-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(19)
}
}

repositories {
mavenCentral()
}
Expand All @@ -28,7 +34,7 @@ dependencies {
var outputImage = 'togetherjava.org:5001/togetherjava/jshellbackend:master' ?: 'latest'

jib {
from.image = 'eclipse-temurin:21'
from.image = 'eclipse-temurin:19'
to {
image = outputImage
auth {
Expand Down
1 change: 1 addition & 0 deletions JShellWrapper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ group 'org.togetherjava'
version '1.0-SNAPSHOT'

mainClassName = 'Main' // Debugging only
sourceCompatibility = 19

run { // Debugging only
standardInput = System.in
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down

0 comments on commit e884315

Please sign in to comment.