Fix javadocs #580
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: Publish | |
on: [push] | |
jobs: | |
publish: | |
if: ${{ github.repository_owner == 'QuiltMC' }} | |
runs-on: ubuntu-latest | |
container: | |
image: eclipse-temurin:17 | |
options: --user root | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: gradle/wrapper-validation-action@v1 | |
# Ensure that releases are not ran in parallel, this ensures that the latest commit is the latest release | |
# See https://github.com/softprops/turnstyle | |
- name: Turnstyle | |
uses: softprops/turnstyle@v1 | |
with: | |
continue-after-seconds: 3600 | |
same-branch-only: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Generate the build number based on tags to allow per branch build numbers, not something github provides by default. | |
- name: Generate build number | |
id: buildnumber | |
uses: onyxmueller/build-tag-number@v1 | |
with: | |
token: ${{ secrets.github_token }} | |
prefix: "build/${{ github.ref }}" | |
- run: ./gradlew build javadoc javadocJar publish --stacktrace | |
env: | |
MAVEN_URL: ${{ secrets.MAVEN_URL }} | |
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
SNAPSHOTS_URL: ${{ secrets.SNAPSHOTS_URL }} | |
SNAPSHOTS_USERNAME: ${{ secrets.SNAPSHOTS_USERNAME }} | |
SNAPSHOTS_PASSWORD: ${{ secrets.SNAPSHOTS_PASSWORD }} | |
BRANCH_NAME: ${{ github.ref }} | |
# Javadoc publishing | |
- name: Install Git | |
run: | | |
apt-get update && apt-get install -y git | |
git --version | |
- name: Clone gh-pages branch | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: 'gh-pages' | |
path: 'gh-pages' | |
- name: Push javadocs to gh-pages | |
run: | | |
rm -rf ./gh-pages/${GITHUB_REF##*/}/ | |
mv ./build/docs/javadoc ./gh-pages/${GITHUB_REF##*/}/ | |
cd gh-pages | |
git add . | |
git config user.name "Github Actions" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git commit --allow-empty -m "Publish javadoc from actions" | |
git push | |
- name: Update Quilt Meta | |
uses: quiltmc/update-quilt-meta@main | |
with: | |
b2-key-id: ${{ secrets.META_B2_KEY_ID }} | |
b2-key: ${{ secrets.META_B2_KEY }} | |
cf-key: ${{ secrets.META_CF_KEY }} |