build(ci): add create release CI #6
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
name: Generate Dokka | |
concurrency: | |
group: "Generate Dokka" | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '*.md' | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout core-stubs | |
uses: actions/checkout@master | |
with: | |
path: "core-stubs" | |
- name: Generate access token | |
id: generate_token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_KEY }} | |
owner: flixclusiveorg | |
repositories: | | |
api | |
- name: Checkout API Reference Repository | |
uses: actions/checkout@master | |
with: | |
repository: 'flixclusiveorg/api' | |
path: 'api' | |
token: ${{ steps.generate_token.outputs.token }} | |
- name: Setup Android SDK | |
run: | | |
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "build-tools;29.0.3" | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: adopt | |
- name: Reset Dokka | |
run: | | |
cd $GITHUB_WORKSPACE/api/ | |
rm -rf * | |
- name: Generate New Dokka | |
run: | | |
cd $GITHUB_WORKSPACE/core-stubs/ | |
chmod +x gradlew | |
./gradlew --no-build-cache --no-configuration-cache :dokkaHtmlMultiModule | |
- name: Update Dokka | |
run: | | |
cp -r $GITHUB_WORKSPACE/core-stubs/build/dokka/htmlMultiModule/* $GITHUB_WORKSPACE/api/ | |
- name: Push builds | |
run: | | |
cd $GITHUB_WORKSPACE/api | |
touch .nojekyll | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add . | |
git commit -m "docs(dokka): update API references [flixclusiveorg/core-stubs@${GITHUB_SHA}]" || exit 0 | |
git push |