Skip to content

Release

Release #18

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
minecraft_version_alias:
type: string
description: 'Minecraft version alias (used for versions that support multiple Minecraft versions)'
required: true
default: '1.21.x'
supported_game_versions:
type: string
description: 'Supported Minecraft versions'
required: true
default: "1.21.1"
version_type:
type: choice
description: 'Type of version to release'
options:
- 'alpha'
- 'beta'
- 'release'
jobs:
release:
name: Release VoluBind
strategy:
matrix:
java: [
21, # Current Java LTS & minimum supported by Minecraft
]
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Get mod version
run: echo "MOD_VERSION=$(./gradlew -q printProjectVersion)"
- name: Build
run: ./gradlew build
- name: Capture build artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
- name: Publish to Modrinth & GitHub Releases
uses: Kir-Antipov/[email protected]
id: publish_pack
with:
modrinth-id: kfEow3K7
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
github-tag: "$MOD_VERSION-${{ github.event.inputs.minecraft_version_alias }}"
github-token: ${{ secrets.GITHUB_TOKEN }}
name: "[${{ github.event.inputs.minecraft_version_alias }}] VoluBind v$MOD_VERSION"
version: "$MOD_VERSION-${{ github.event.inputs.minecraft_version_alias }}"
version-type: ${{ github.event.inputs.version_type }}
loaders: |
fabric
quilt
game-versions: |
"${{ github.event.inputs.supported_game_versions }}"
dependencies: |
fabric-api
owo-lib
java: ${{ matrix.java }}
files: |
build/libs/!(*-@(dev|sources|javadoc)).jar
build/libs/*-@(dev|sources|javadoc).jar
- name: Publish to Maven repository
run: ./gradlew publish
- name: Send Discord webhook
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
content: "<@&1000858651243843765>"
username: "VoluBind - v$MOD_VERSION"
avatar-url: "https://cdn.jsdelivr.net/gh/LilydevMC/assets/volubind/assets/icon.png"
embed-author-name: ${{ github.repository_owner }}
embed-author-icon-url: "https://github.com/${{ github.repository_owner }}.png"
embed-title: "VoluBind v$MOD_VERSION"
embed-color: 0x9567F0
embed-thumbnail-url: "https://cdn.jsdelivr.net/gh/LilydevMC/assets/volubind/assets/icon.png"
embed-description: |
- <:modrinth:1000522854766497813> **[Modrinth](${{ steps.publish_pack.outputs.modrinth-url }})** (Recommended)
- <:github_light:1000525612911444118> [GitHub Releases](${{ steps.publish_pack.outputs.github-url }})
- <:code:1281043625333231628> [Source code](https://github.com/${{ github.repository }})