From 81a6ab807063c1dee8554c539491645e41495565 Mon Sep 17 00:00:00 2001 From: reallyakera Date: Fri, 13 Oct 2023 05:58:13 +0530 Subject: [PATCH] workflow --- .github/workflows.yml | 18 ++++++++ .github/workflows/high-perf-dac.yml | 65 +++++++++++++++++++++++++++ .github/workflows/jekyll-gh-pages.yml | 51 +++++++++++++++++++++ .github/workflows/manual.yml | 32 +++++++++++++ .github/workflows/master.yml | 13 ++++++ build.sh | 14 ++++++ 6 files changed, 193 insertions(+) create mode 100644 .github/workflows.yml create mode 100644 .github/workflows/high-perf-dac.yml create mode 100644 .github/workflows/jekyll-gh-pages.yml create mode 100644 .github/workflows/manual.yml create mode 100644 .github/workflows/master.yml create mode 100644 build.sh diff --git a/.github/workflows.yml b/.github/workflows.yml new file mode 100644 index 0000000..5ac0af3 --- /dev/null +++ b/.github/workflows.yml @@ -0,0 +1,18 @@ +- name: Upload a Build Artifact + uses: actions/upload-artifact@v3.1.3 + with: + # Artifact name + name: # optional, default is artifact + # A file, directory or wildcard pattern that describes what to upload + path: + # The desired behavior if no files are found using the provided path. +Available Options: + warn: Output a warning but do not fail the action + error: Fail the action with an error message + ignore: Do not output any warnings or errors, the action does not fail + + if-no-files-found: # optional, default is warn + # Duration after which artifact will expire in days. 0 means using default retention. +Minimum 1 day. Maximum 90 days unless changed from the repository settings page. + + retention-days: # optional diff --git a/.github/workflows/high-perf-dac.yml b/.github/workflows/high-perf-dac.yml new file mode 100644 index 0000000..176bcca --- /dev/null +++ b/.github/workflows/high-perf-dac.yml @@ -0,0 +1,65 @@ +name: High-Perf-Dac + +on: + push: + branches: [ master ] + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + container: + image: z4nyx/docker:latest + + - name: Download a Build Artifact + uses: actions/download-artifact@v2.1.0 + + + steps: + - uses: actions/checkout@v2 + - name: yakt ToolChain Compile + run: bash build.sh + env: + token: ${{ secrets.TOKEN }} + chat_id: ${{ secrets.CHAT_ID }} + + steps: +- uses: actions/checkout@v2 + +- uses: actions/download-artifact@v2 + with: + name: my-artifact + +- name: Display structure of downloaded files + run: ls -R + + steps: +- uses: actions/checkout@v2 + +- uses: actions/download-artifact@v2 + +- name: Display structure of downloaded files + run: ls -R + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v3.1.3 + + + - name: Cache + uses: actions/cache@v3.3.2 + with: + # A list of files, directories, and wildcard patterns to cache and restore + path: + # An explicit key for restoring and saving the cache + key: + # An ordered list of keys to use for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case. + restore-keys: # optional + # The chunk size used to split up large files during upload, in bytes + upload-chunk-size: # optional + # An optional boolean when enabled, allows windows runners to save or restore caches that can be restored or saved respectively on other platforms + enableCrossOsArchive: # optional, default is false + # Fail the workflow if cache entry is not found + fail-on-cache-miss: # optional, default is false + # Check if a cache entry exists for the given input(s) (key, restore-keys) without downloading the cache + lookup-only: # optional, default is false diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml new file mode 100644 index 0000000..482459b --- /dev/null +++ b/.github/workflows/jekyll-gh-pages.yml @@ -0,0 +1,51 @@ +# Sample workflow for building and deploying a Jekyll site to GitHub Pages +name: Deploy Jekyll with GitHub Pages dependencies preinstalled + +on: + # Runs on pushes targeting the default branch + push: + branches: ["master"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: 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 production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./ + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 0000000..11b2e35 --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,32 @@ +# This is a basic workflow that is manually triggered + +name: Manual workflow + +# Controls when the action will run. Workflow runs when manually triggered using the UI +# or API. +on: + workflow_dispatch: + # Inputs the workflow accepts. + inputs: + name: + # Friendly description to be shown in the UI instead of 'name' + description: 'Person to greet' + # Default value if no value is explicitly provided + default: 'World' + # Input has to be provided for the workflow to run + required: true + # The data type of the input + type: string + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "greet" + greet: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Runs a single command using the runners shell + - name: Send greeting + run: echo "Hello ${{ inputs.name }}" diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 0000000..ecc11db --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,13 @@ +steps: +- uses: actions/checkout@v3 +- uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + cache: 'gradle' +- run: ./gradlew build --no-daemon + +- uses: actions/download-artifact@v2 + +- name: Display structure of downloaded files + run: ls -R diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..7385fb8 --- /dev/null +++ b/build.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +VERSION=$(grep_prop Version module.prop 2>/dev/null) +# Set a commit head +COMMIT_HEAD="$(git log --oneline -1)" +function push() { +curl -F document=@$1 "https://api.telegram.org/bot${token}/sendDocument" \ + -F chat_id="${chat_id}" \ + -F "disable_web_page_preview=true" \ + -F "parse_mode=html" \ + -F caption="${COMMIT_HEAD}" +} +rm -rf *.zip +zip -r9 "high_perf_dac-$VERSION.zip" . -x *build* -x *changelog* -x *.bak* -x *.git* *.github* +push "high_perf_dac-$VERSION.zip"