Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
teogor committed Aug 30, 2024
0 parents commit de712f6
Showing 213 changed files with 25,495 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .fleet/receipt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Project generated by Kotlin Multiplatform Wizard
{
"spec": {
"template_id": "kmt",
"targets": {
"android": {
"ui": [
"compose"
]
},
"ios": {
"ui": [
"compose"
]
},
"desktop": {
"ui": [
"compose"
]
},
"web": {
"ui": [
"compose"
]
}
}
},
"timestamp": "2024-08-25T13:29:15.336318592Z"
}
16 changes: 16 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# More details are here: https://help.github.com/articles/about-codeowners/

# The '*' pattern is global owners.
# Not adding in this PR, but I'd like to try adding a global owner set with the entire team.
# One interpretation of their docs is that global owners are added only if not removed
# by a more local rule.

# Order is important. The last matching pattern has the most precedence.
# The folders are ordered as follows:

# In each subsection folders are ordered first by depth, then alphabetically.
# This should make it easy to add new rules without breaking existing ones.
* @teogor
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: [ teogor ]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
60 changes: 60 additions & 0 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Deploy Kotlin/Wasm to GitHub Pages

on:
workflow_dispatch:
push:
branches:
- main

jobs:
# Build job
build:
name: Build Kotlin/WASM Artifacts
runs-on: ubuntu-latest
steps:
- name: Set up Java Development Kit (JDK)
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'

- name: Checkout Repository
uses: actions/checkout@v4

- name: Grant Execute Permissions to Gradle Wrapper
run: chmod +x gradlew

- name: Update Yarn Lock File
run: ./gradlew kotlinUpgradeYarnLock

- name: Execute Gradle Build Tasks
run: ./gradlew wasmJsBrowserDistribution

- name: Fix File Permissions for Artifacts
run: |
chmod -v -R +rX "demo/composeApp/build/dist/wasmJs/productionExecutable/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload Artifacts to Pages
uses: actions/upload-pages-artifact@v3
with:
path: demo/composeApp/build/dist/wasmJs/productionExecutable/

deploy:
name: Deploy Artifacts to GitHub Pages
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
136 changes: 136 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Deploy Docs

on:
workflow_dispatch:
push:
branches:
- main

permissions:
contents: write
pages: write
id-token: write
pull-requests: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these deploy-docs deployments to complete.
concurrency:
group: "deploy-docs"
cancel-in-progress: false

env:
OWNER: teogor
DESTINATION_BRANCH: docs/teogor/${{ github.event.repository.name }}/${{ github.sha }}
REPOSITORY: ${{ github.event.repository.name }}
REPO: teogor/${{ github.event.repository.name }}
DISPLAY_NAME: Paletteon

jobs:
synchronize-documentation:
environment: deploy-docs
runs-on: ubuntu-latest
name: Synchronize Repository Documentation
steps:
- uses: actions/checkout@v4

# Grants execute permission to gradle (safety step)
- name: Grant Permissions to gradlew
run: chmod +x gradlew

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs-material
pip install mkdocs-material[recommended,git,imaging]
- name: Build MkDocs
run: |
mkdocs build --clean
mkdocs --version
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

- name: Generate API Documentation
run: ./gradlew -D'org.gradle.unsafe.configuration-cache=false' dokkaHtmlMultiModule

- name: Relocate API References
run: |
mkdir -p build/docs/${{ env.REPOSITORY }}/html
cp -r build/dokka/htmlMultiModule/* build/docs/${{ env.REPOSITORY }}/html
- id: publish-docs
name: Deploy Documentation
uses: ./.github/workflows/sync-docs/
env:
API_TOKEN_GITHUB: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
source-file: build/docs/${{ env.REPOSITORY }}/
destination-folder: ${{ env.REPOSITORY }}
destination-repo: teogor/source.teogor.dev
user-email: open-source@teogor.dev
user-name: Teodor Grigor
destination-branch-create: ${{ env.DESTINATION_BRANCH }}

build-and-deploy:
environment: deploy-docs
needs: synchronize-documentation
name: Build and Deploy Updated API Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout other repository
uses: actions/checkout@v3
with:
repository: teogor/source.teogor.dev
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
ref: ${{ env.DESTINATION_BRANCH || 'main' }}
# This is important to fetch the changes to the previous commit
fetch-depth: 0

# - name: Prettify code
# uses: creyD/prettier_action@v4.3
# with:
# # This part is also where you can pass other options, for example:
# prettier_options: --write ${{ env.REPOSITORY }}/**/*.{js,html,css,json}
# only_changed: False
# same_commit: True

- name: Create PR (Pull Request)
run: |
json=$(curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/teogor/source.teogor.dev/pulls \
-d '{
"title":"Updated documentation for `${{ env.REPO }}`",
"body":"## 🚀 **Updated Documentation for ${{ env.DISPLAY_NAME }}** 🚀\n\nThis pull request brings you the latest updates to the [${{ env.DISPLAY_NAME }}](https://github.com/${{ env.REPO }}) documentation, ensuring you have access to the most comprehensive and informative guide for using this powerful library.\n\n-------\n\n* Generated by [Publish Docs](https://github.com/${{ env.REPO }}/actions/workflows/publish-docs.yml)\n\n* From [${{ env.REPO }}](https://github.com/${{ env.REPO }})",
"head":"${{ env.DESTINATION_BRANCH }}",
"base":"main"
}' | jq .)
number=$(jq '.number' <<< ${json})
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/teogor/source.teogor.dev/issues/${number}/labels \
-d '{"labels":["@documentation"]}'
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/teogor/source.teogor.dev/pulls/${number}/merge \
49 changes: 49 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish

on:
release:
types: [ released ]
workflow_dispatch:

jobs:
publish:
name: Snapshot build and publish
runs-on: macos-latest
environment: release
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'

- name: Install GPG
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
run: |
brew install gpg
echo "$SIGNING_KEY" | gpg --dearmor > ${HOME}/secring.gpg
- name: Grant Permission to Execute Gradle
run: chmod +x gradlew

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Publish To Maven Central
run: |
./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache --stacktrace
65 changes: 65 additions & 0 deletions .github/workflows/sync-docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 'Publish Docs'
description: 'Comprehensive publish docs'
branding:
icon: 'git-commit'
color: 'red'
inputs:
source-file:
description: 'Source file from the origin directory'
required: true
destination-repo:
description: 'Destination repository'
required: true
destination-folder:
description: 'Directory to push the file to'
required: false
user-email:
description: 'Email for the git commit'
required: true
user-name:
description: 'GitHub username for the commit'
required: true
destination-branch:
description: 'branch to push file to, defaults to main'
required: false
destination-branch-create:
description: 'Destination branch to create for this commit'
required: false
commit-message:
description: 'A custom message for the commit'
required: false
rename:
description: 'Rename the destination file'
required: false
use-rsync:
description: 'Copy files/directories using rsync instead of cp. Experimental feature, please know your use case'
required: false
git-server:
description: 'Git server host, default github.com'
required: false
default: github.com
runs:
using: "composite"
steps:
- name: Make all .sh files executable
run: find . -type f -name "*.sh" -exec chmod +x {} \;
shell: bash

- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
shell: bash

- name: Execute Entrypoint Script
shell: bash
env:
SOURCE_FILE: ${{ inputs.source-file }}
DESTINATION_REPO: ${{ inputs.destination-repo }}
DESTINATION_FOLDER: ${{ inputs.destination-folder }}
USER_EMAIL: ${{ inputs.user-email }}
USER_NAME: ${{ inputs.user-name }}
DESTINATION_BRANCH: ${{ inputs.destination-branch }}
DESTINATION_BRANCH_CREATE: ${{ inputs.destination-branch-create }}
COMMIT_MESSAGE: ${{ inputs.commit-message }}
GIT_SERVER: ${{ inputs.git-server }}
RENAME: ${{ inputs.rename }}
USE_RSYNC: ${{ inputs.use-rsync }}
run: sync-files.sh
Loading

0 comments on commit de712f6

Please sign in to comment.