Skip to content

[exclc] Bump auto update tool to 1.0.9 #1

[exclc] Bump auto update tool to 1.0.9

[exclc] Bump auto update tool to 1.0.9 #1

Workflow file for this run

name: Updates version and publishes to Maven, Modrinth, and CurseForge
on:
push:
tags:
- '*'
permissions:
contents: write
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Write new version to gradle.properties file
uses: anbazhagan45/[email protected]
with:
source_path: './gradle.properties'
target_path: './gradle.properties'
property: |
modVersion
value: |
${{ github.ref_name }}
- name: Commit gradle properties
run: |
git config --global user.name 'Publish Action'
git config --global user.email '[email protected]'
git commit -am "[exclc] Bump version to ${{ github.ref_name }}"
git push
publish:
runs-on: ubuntu-latest
needs: update-version
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Download version info file
uses: carlosperate/download-file-action@v2
with:
file-url: 'https://github.com/DynamicTreesTeam/DynamicTreesVersionInfo/blob/master/DynamicTrees.json?raw=true'
file-name: 'version_info.json'
location: './build'
- name: Run autoUpdate task
run: ./gradlew autoUpdate
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
- name: Push version info to repo
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: 'build/version_info.json'
destination_repo: 'DynamicTreesTeam/DynamicTreesVersionInfo'
destination_branch: 'master'
rename: 'DynamicTrees.json'
user_email: '[email protected]'
user_name: 'Harleyoc1'
commit_message: 'Updated version info for Dynamic Trees'