Updated for 1.21.4 #36
Workflow file for this run
This file contains hidden or 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: Release | |
on: | |
push: | |
# Pattern matched against refs/tags | |
tags: | |
- '*' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
# Full clone to allow getting the last tag | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
with: | |
gradle-version: 8.1.1 | |
- name: Cache Gradle files | |
uses: actions/cache@v2 | |
if: ${{ !env.ACT }} | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('*/build.gradle', '*/settings.gradle', '*gradle.*') }} | |
restore-keys: ${{ runner.os }}-gradle- | |
- name: Setup Vars | |
id: vars | |
run: | | |
echo "LAST_TAG=$(git describe --abbrev=0 HEAD^ --tags)" >> "$GITHUB_OUTPUT" | |
echo "MOD_VERSION=$(gradle -q printVersion)" >> "$GITHUB_OUTPUT" | |
- name: Setup release info | |
id: releaseInfo | |
uses: cardinalby/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
tag: ${{ github.ref_name }} | |
- name: Version Check | |
if: ${{ steps.vars.outputs.MOD_VERSION != github.ref_name }} | |
uses: actions/github-script@v3 | |
with: | |
script: | | |
core.setFailed("Mod configured with incorrect version\nMod Version: ${{steps.vars.outputs.MOD_VERSION}}\nGithub Version: ${{github.ref_name}}") | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: deploy | |
env: | |
MAVENREPOUSER: ${{secrets.MAVENREPOUSER}} | |
MAVENREPOPASS: ${{secrets.MAVENREPOPASS}} | |
MODRINTH_TOKEN: ${{secrets.MODRINTH_TOKEN}} | |
CURSEFORGE_TOKEN: ${{secrets.CURSEFORGE_TOKEN}} | |
CHANGELOG: ${{steps.releaseInfo.outputs.body}} | |
run: gradle publish | |
shell: bash | |
- name: Upload jar to release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ./build/libs/datmoddingapi-*.jar | |
- name: Generate Javadoc | |
run: gradle javadoc | |
shell: bash | |
- name: Upload javadoc | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: './build/docs/javadoc' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |