Skip to content

Publish on Release

Publish on Release #1

name: Publish on Release
on:
release:
types: [released]
# TODO: Make it so you can publish releases for each mc-ver individually
jobs:
meta:
name: Metadata
runs-on: ubuntu-latest
outputs:
CHANGELOG: ${{ steps.changelog.outputs.changelog }}
permissions:
contents: write
pull-requests: read
steps:
- name: Get Config
uses: actions/checkout@v4
with:
ref: '1.20.1'
sparse-checkout: '.github/json'
- name: Generate changelog
id: changelog
env:
GITHUB_TOKEN: ${{ github.token }}
uses: mikepenz/release-changelog-builder-action@v5
with:
configuration: ./.github/json/config.json
toTag: ${{ github.event.release.tag }}
ignorePreReleases: true
fetchViaCommits: true
failOnError: true
publish-20:
name: 1.20.1
needs: [ meta ]
secrets: inherit
uses: ./.github/workflows/publish.yml
with:
simulate: ${{ startsWith(github.event.release.name, 'simulate') || github.repository_owner != 'GregTechCEu' }}
branch: '1.20.1'
tag-name: ${{ github.ref_name }}
release-body: ${{ github.event.release.body }}
changelog-body: ${{ needs.meta.outputs.CHANGELOG }}
publish-21:
name: 1.21.1
needs: [ meta ]
secrets: inherit
uses: ./.github/workflows/publish.yml
with:
simulate: ${{ startsWith(github.event.release.name, 'simulate') || github.repository_owner != 'GregTechCEu' }}
branch: '1.21'
tag-name: ${{ github.ref_name }}
release-body: ${{ github.event.release.body }}
changelog-body: ${{ needs.meta.outputs.CHANGELOG }}