-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
19e917d
commit c17544e
Showing
4 changed files
with
98 additions
and
67 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 |
---|---|---|
@@ -1,6 +1,3 @@ | ||
# This script requires the following secrets to be set in the repository settings: | ||
# - SELF_PASSWORD | ||
|
||
name: Build | ||
|
||
on: | ||
|
@@ -17,83 +14,101 @@ on: | |
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
permissions: | ||
contents: write | ||
steps: | ||
# ==================== SETUPS ==================== | ||
|
||
# ==================== SETUPS ==================== | ||
|
||
- name: Setup codebase | ||
- name: Checkout Codebase | ||
uses: actions/checkout@v4 | ||
with: | ||
node-version: '12.x' | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4.7.1 | ||
uses: actions/setup-python@v5.2.0 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: zulu | ||
java-version: 19 | ||
java-version: 21 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
gradle-version: 7.6.1 | ||
build-scan-publish: true | ||
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | ||
build-scan-terms-of-use-agree: "yes" | ||
|
||
# ==================== VERSION ===================== | ||
# ==================== INCREMENT VERSION ===================== | ||
|
||
|
||
- name: External scripts - Increment version | ||
- name: Increment Version | ||
run: | | ||
wget -O tmp-increment_version.py https://raw.githubusercontent.com/L1ghtDream/report/cdn/increment_version-v2.py | ||
python tmp-increment_version.py | ||
python3 scripts/increment_version.py | ||
# ==================== PUBLISH ==================== | ||
|
||
# ==================== BUILD ==================== | ||
- name: Commit to Repository | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: Incremented patch version | ||
commit_options: '--no-verify --signoff' | ||
commit_user_name: Voinea Radu | ||
commit_user_email: [email protected] | ||
|
||
# ==================== BUILD ==================== | ||
|
||
- name: Execute Gradle build | ||
run: ./gradlew build | ||
- name: Export Credentials | ||
run: | | ||
mkdir -p ~/.gradle | ||
echo " | ||
com.voinearadu.url=https://repository.voinearadu.com/repository/maven-releases/ | ||
com.voinearadu.auth.username=admin | ||
com.voinearadu.auth.password=${{ secrets.NEXUS_PASSWORD }} | ||
" > ~/.gradle/gradle.properties | ||
if [ "${{ secrets.NEXUS_PASSWORD }}" == "" ]; then echo "com.voinearadu.publish=false" >> ~/.gradle/gradle.properties; fi | ||
- name: Cache Gradle Dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle | ||
restore-keys: | | ||
${{ runner.os }}-gradle | ||
- name: Set gradle permissions | ||
run: chmod +x gradlew | ||
|
||
# ==================== EXTERNAL SCRIPTS ==================== | ||
- name: Execute Gradle Build | ||
run: ./gradlew build | ||
|
||
# ==================== ENVIRONMENT VARIABLES ==================== | ||
|
||
- name: External scripts - Environment Variables | ||
run: | | ||
wget -O tmp-environment_variables.sh https://raw.githubusercontent.com/L1ghtDream/report/cdn/environment_variables.sh | ||
chmod +x tmp-environment_variables.sh | ||
./tmp-environment_variables.sh ${{ github.REPOSITORY }} | ||
- name: External scripts - Readme | ||
run: | | ||
wget -O tmp-create_readme.py https://raw.githubusercontent.com/L1ghtDream/report/cdn/create_readme-v2.py | ||
python tmp-create_readme.py ${{ env.REPOSITORY_NAME }} ${{ env.ARTIFACT }} ${{ env.VERSION }} | ||
echo "VERSION=$(./gradlew properties -q | grep "^version:" | awk '{print $2}')" >> $GITHUB_ENV | ||
echo "ARTIFACT=$(./gradlew properties -q | grep "^name:" | awk '{print $2}')" >> $GITHUB_ENV | ||
echo "GROUP=$(./gradlew properties -q | grep "^group:" | awk '{print $2}')" >> $GITHUB_ENV | ||
echo "REPOSITORY_NAME=$(echo $REPOSITORY_NAME | awk -F'/' '{print $2}')" >> $GITHUB_ENV | ||
# ==================== PUBLISH ==================== | ||
|
||
|
||
- name: Uploading artifacts | ||
run: | | ||
wget -O tmp-publish.sh https://raw.githubusercontent.com/L1ghtDream/report/cdn/publish.sh | ||
chmod +x tmp-publish.sh | ||
./tmp-publish.sh ${{ github.REPOSITORY }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.SELF_PASSWORD }} | ||
- name: Execute Gradle Publish | ||
run: ./gradlew publish | ||
|
||
- name: Automatic Releases | ||
uses: marvinpinto/[email protected] | ||
if: github.event_name != 'pull_request' | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "${{ env.VERSION }}" | ||
prerelease: false | ||
prerelease: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' }} | ||
title: "${{ env.VERSION }}" | ||
files: | | ||
build/libs/*.jar | ||
- name: Commit any changes made to the repo | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: Incremented patch version | ||
commit_options: '--no-verify --signoff' | ||
|
||
commit_user_name: Radu Voinea | ||
commit_user_email: [email protected] | ||
src/*/build/libs/*.jar | ||
src/*/*/build/libs/*.jar | ||
src/*/*/*/build/libs/*.jar |
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 |
---|---|---|
@@ -1,34 +1,49 @@ | ||
name: PR Check | ||
name: Pull Request Check | ||
|
||
on: [ pull_request ] | ||
|
||
jobs: | ||
build: | ||
pull-request-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# ===== SETUPS ====== | ||
timeout-minutes: 60 | ||
|
||
- name: Setup codebase | ||
steps: | ||
# ==================== SETUPS ==================== | ||
- name: Checkout Codebase | ||
uses: actions/checkout@v4 | ||
with: | ||
node-version: '12.x' | ||
|
||
|
||
# ===== JAVA ====== | ||
|
||
- name: Setup Python | ||
uses: actions/[email protected] | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: zulu | ||
java-version: 19 | ||
java-version: 21 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
gradle-version: 7.6.1 | ||
|
||
# ===== BUILD ====== | ||
build-scan-publish: true | ||
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | ||
build-scan-terms-of-use-agree: "yes" | ||
|
||
# ==================== BUILD ==================== | ||
|
||
- name: Execute Gradle build | ||
run: gradle build | ||
|
||
- name: Cache Gradle Dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle | ||
restore-keys: | | ||
${{ runner.os }}-gradle | ||
- name: Set gradle permissions | ||
run: chmod +x gradlew | ||
|
||
- name: Execute Gradle Build | ||
run: ./gradlew build |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
# Done to increase the memory available to gradle. | ||
org.gradle.jvmargs=-Xmx5G | ||
|
||
com.voinearadu.publish=true |