Skip to content

Commit

Permalink
GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ephemient committed May 15, 2022
1 parent c76e782 commit bafdcf1
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: gradle
directory: /
schedule:
interval: daily
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Continuous Integration

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11
- uses: android-actions/setup-android@v2
- uses: gradle/gradle-build-action@v2
with:
arguments: build

gradle-wrapper-validation:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
46 changes: 46 additions & 0 deletions .github/workflows/gh-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Dokka

on:
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
path: main
- uses: actions/checkout@v2
with:
ref: gh-docs
path: gh-docs
- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11
- uses: gradle/gradle-build-action@v2
with:
build-root-directory: main
arguments: dokkaGfm
- name: Copy
run: |
rm -rf gh-docs/dokka/
names=()
for src in main/**/build/dokka/gfm; do
name=${src#main}
name=${name%/build/dokka/gfm}
name=${name#/}
names+=("$name")
mkdir -p "gh-docs/dokka/$name"
rsync --recursive --verbose "main/$name/build/dokka/gfm/" "gh-docs/dokka/$name"
done
for name in "${names[@]}"; do
printf '[%s](dokka/%s)\n' "$name" "$name"
done > gh-docs/dokka.md
- name: Commit
uses: EndBug/add-and-commit@v9
with:
cwd: gh-docs
message: 'Dokka ${{ github.sha }}'
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish

on:
release:
types:
- created

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11
- uses: android-actions/setup-android@v2
- id: tag
name: Extract tag name
uses: actions/github-script@v2
with:
script: |
const tagNS = "refs/tags/";
const ref = context.ref;
return ref && ref.startsWith(tagNS)
? ref.substr(tagNS.length + (ref[tagNS.length] == "v"))
: '';
result-encoding: string
- uses: gradle/gradle-build-action@v2
with:
arguments: -Pversion=${{ steps.tag.outputs.result }} publishAllPublicationsToGitHubPackagesRepository
env:
ORG_GRADLE_PROJECT_GitHubPackagesUsername: ${{ github.actor }}
ORG_GRADLE_PROJECT_GitHubPackagesPassword: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit bafdcf1

Please sign in to comment.