2023-11-22 01:23:23 +01:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
2024-11-18 16:46:16 +01:00
|
|
|
- main
|
2023-11-22 01:23:23 +01:00
|
|
|
name: release-please
|
|
|
|
jobs:
|
|
|
|
release-please:
|
|
|
|
runs-on: ubuntu-latest
|
2024-11-19 01:27:54 +01:00
|
|
|
environment: release
|
2023-11-22 01:23:23 +01:00
|
|
|
outputs:
|
|
|
|
release_created: ${{ steps.release.outputs.release_created }}
|
|
|
|
upload_url: ${{ steps.release.outputs.upload_url }}
|
|
|
|
# https://github.com/google-github-actions/release-please-action in case more config is needed
|
|
|
|
steps:
|
2024-06-16 05:00:49 +02:00
|
|
|
- uses: google-github-actions/release-please-action@v3
|
|
|
|
id: release
|
|
|
|
with:
|
|
|
|
command: manifest
|
|
|
|
token: ${{ secrets.PAT }}
|
2023-11-22 01:23:23 +01:00
|
|
|
# See how to configure file https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md
|
|
|
|
# See output info at https://github.com/google-github-actions/release-please-action#configuration for variables
|
|
|
|
|
|
|
|
# Possibly optimise this by building and then passing the folder across to these stages
|
|
|
|
release:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
release-task: [curseforge, discordupload, modrinth]
|
|
|
|
needs: release-please
|
|
|
|
runs-on: ubuntu-latest
|
2024-11-19 01:27:54 +01:00
|
|
|
environment: release
|
2023-11-22 01:23:23 +01:00
|
|
|
if: ${{ needs.release-please.outputs.release_created }}
|
|
|
|
steps:
|
2024-06-16 05:00:49 +02:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Cache Gradle packages
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
|
|
|
restore-keys: ${{ runner.os }}-gradle
|
|
|
|
- name: Set up JDK 17
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
distribution: zulu
|
|
|
|
java-version: 17
|
|
|
|
- name: Download MC assets
|
|
|
|
run: ./gradlew downloadAssets || ./gradlew downloadAssets || (sleep 30s && ./gradlew downloadAssets)
|
|
|
|
- name: Run DataGen
|
|
|
|
run: ./gradlew runData
|
|
|
|
- name: Build and publish (release)
|
|
|
|
env:
|
|
|
|
CURSE_API: ${{ secrets.CURSE_API }}
|
|
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
|
|
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
|
|
|
|
IS_RELEASE: true
|
|
|
|
run: |
|
|
|
|
# Build
|
|
|
|
./gradlew build ${{ matrix.release-task }}
|