Skip to content

Commit

Permalink
✨ Migrate package, woo
Browse files Browse the repository at this point in the history
  • Loading branch information
DeJayDev committed Jun 13, 2022
1 parent 8507af3 commit e58a3c9
Show file tree
Hide file tree
Showing 136 changed files with 2,422 additions and 2,773 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI

on:
workflow_dispatch:
push:
branches:
- master
Expand All @@ -22,7 +23,10 @@ jobs:
with:
distribution: 'corretto'
java-version: '17'
cache: 'maven'
cache: 'gradle'

- name: Build with Maven
run: mvn -B test package --file pom.xml
- name: Validate Gradle
uses: gradle/wrapper-validation-action@v1

- name: Build with Gradle
run: ./gradlew build
87 changes: 46 additions & 41 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Build documentation

on:
push:
branches: [master]

jobs:
javadoc:
runs-on: ubuntu-latest
Expand All @@ -14,46 +16,49 @@ jobs:
with:
distribution: 'corretto'
java-version: '17'
cache: 'maven'
cache: 'gradle'

- name: Build JavaDoc
run: mvn -B javadoc:javadoc -pl quartzlib --file pom.xml
- name: Validate Gradle
uses: gradle/wrapper-validation-action@v1

- name: Checkout website repository
uses: actions/checkout@v2
with:
repository: zDevelopers/zdevelopers.github.io
path: web
branch: master
persist-credentials: false

- name: Push built documentation to website repository
shell: bash
run: |
# Extract project name
PROJECT_NAME=${GITHUB_REPOSITORY##*/}
PROJECT_NAME_LOWER=${PROJECT_NAME,,}
# Create dir if needed, cleanup old doc and copy new one
mkdir -p web/static/docs/
rm -rf web/static/docs/$PROJECT_NAME_LOWER
cp -r quartzlib/target/site/apidocs web/static/docs/$PROJECT_NAME_LOWER
# Go to website repository
cd web
# Configure git to push to this repository
git config --global user.name QuartzBot
git config --global user.email moriplay@zcraft.fr
git config --global user.password ${{ secrets.QUARTZ_BOT_TOKEN }}
# Add files
echo ::group::Commit
git add .
git commit -m "Updated documentation for $PROJECT_NAME"
echo ::endgroup::
# Push
echo ::group::Push
git push https://QuartzBot:${{ secrets.QUARTZ_BOT_TOKEN }}@github.com/zDevelopers/zdevelopers.github.io.git
echo ::endgroup::
- name: Build Javadoc
run: ./gradlew javadocs

# - name: Checkout website repository
# uses: actions/checkout@v2
# with:
# repository: zDevelopers/zdevelopers.github.io
# path: web
# branch: master
# persist-credentials: false

#- name: Push built documentation to website repository
# shell: bash
# run: |
# # Extract project name
# PROJECT_NAME=${GITHUB_REPOSITORY##*/}
# PROJECT_NAME_LOWER=${PROJECT_NAME,,}

# # Create dir if needed, cleanup old doc and copy new one
# mkdir -p web/static/docs/
# rm -rf web/static/docs/$PROJECT_NAME_LOWER
# cp -r ezlib/target/site/apidocs web/static/docs/$PROJECT_NAME_LOWER

# # Go to website repository
# cd web

# # Configure git to push to this repository
# git config --global user.name QuartzBot
# git config --global user.email moriplay@zcraft.fr
# git config --global user.password ${{ secrets.QUARTZ_BOT_TOKEN }}

# # Add files
# echo ::group::Commit
# git add .
# git commit -m "Updated documentation for $PROJECT_NAME"
# echo ::endgroup::

# # Push
# echo ::group::Push
# git push https://QuartzBot:${{ secrets.QUARTZ_BOT_TOKEN }}@github.com/zDevelopers/zdevelopers.github.io.git
# echo ::endgroup::
46 changes: 1 addition & 45 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,48 +31,4 @@ jobs:
with:
distribution: 'corretto'
java-version: '17'
cache: 'maven'

- name: Extract project name
id: project-name
uses: actions/github-script@v3
with:
script: return context.repo.repo
result-encoding: string

- name: Publish to GitHub Packages
id: maven-publish
run: |
TAG_NAME=${GIT_REF_NAME##*/}
REVISION_NAME=${TAG_NAME:1}
mvn -B deploy -pl quartzlib -am "-Drevision=$REVISION_NAME"
JAR_PATH=$(ls ./quartzlib/target/*.jar | tail -n 1)
JAR_NAME=$(basename $JAR_PATH)
echo "::set-output name=jar_path::$JAR_PATH"
echo "::set-output name=jar_name::$JAR_NAME"
env:
GIT_REF_NAME: ${{ github.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create new GitHub Release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ steps.project-name.outputs.result }} ${{ github.ref }}
draft: true
prerelease: false

- name: Upload GitHub Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ steps.maven-publish.outputs.jar_path }}
asset_name: ${{ steps.maven-publish.outputs.jar_name }}
asset_content_type: application/java-archive
cache: 'gradle'
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e58a3c9

Please sign in to comment.