Skip to content

Build and Publish

Build and Publish #10

name: Build and Publish
on:
push:
tags:
- 'v**'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up OpenJDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
- name: Get version from tag
id: tag_name
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
shell: bash
- name: Read property from gradle.properties
id: read_property
run: echo "MC_VERSION=$(grep -Po 'mc_version=\K.*' gradle.properties)" >> $GITHUB_ENV
- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: build
cache-read-only: false
gradle-home-cache-cleanup: true
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_level: warn
version: ${{ steps.tag_name.outputs.current_version }}
path: ./CHANGELOG.md
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
draft: false
name: Ars Ocultas ${{ env.MC_VERSION }}-${{ steps.tag_name.outputs.current_version }}
body: ${{ steps.changelog_reader.outputs.changes }}
tag: ${{ github.ref }}
artifacts: ./build/libs/ars_ocultas-${{ env.MC_VERSION }}-${{ steps.tag_name.outputs.current_version }}-all.jar
artifactContentType: application/java-archive
- name: Upload to Mod Platforms
uses: Kir-Antipov/mc-publish@v3.3
with:
modrinth-id: Tsw8vbks
modrinth-token: ${{ secrets.MODRINTH_API_KEY }}
curseforge-id: 907843
curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }}
files: |
build/libs/ars_ocultas-${{ env.MC_VERSION }}-${{ steps.tag_name.outputs.current_version }}-all.jar
name: Ars Ocultas ${{ env.MC_VERSION }}-${{ steps.tag_name.outputs.current_version }}
version: ${{ env.MC_VERSION }}-${{ steps.tag_name.outputs.current_version }}
game-versions: |
${{ env.MC_VERSION }}
changelog: |-
${{ steps.changelog_reader.outputs.changes }}
dependencies: |
forge(required)
ars-nouveau(required)
occultism(required)