-
Notifications
You must be signed in to change notification settings - Fork 185
58 lines (54 loc) · 1.8 KB
/
publish-on-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Publish on Release
on:
release:
types: [released]
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 }}
CONFIG: ${{ contains(github.ref_name, '1.21') && '-1.21' || '' }}
uses: mikepenz/release-changelog-builder-action@v5
with:
configuration: './.github/json/config${{ env.CONFIG }}.json'
ignorePreReleases: true
fetchViaCommits: true
failOnError: true
publish-20:
name: 1.20.1
needs: [ meta ]
if: ${{ contains(github.ref_name, '1.20.1') || !contains(github.ref_name, '1.21') }}
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 ]
if: ${{ contains(github.ref_name, '1.21') || !contains(github.ref_name, '1.20.1') }}
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 }}