Skip to content

Merge branch '1.21' into 1.20.3 #69

Merge branch '1.21' into 1.20.3

Merge branch '1.21' into 1.20.3 #69

Workflow file for this run

on:

Check failure on line 1 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

(Line: 69, Col: 5): Unexpected value 'uses', (Line: 70, Col: 5): Unexpected value 'with', (Line: 61, Col: 5): Required property is missing: runs-on, (Line: 87, Col: 5): Unexpected value 'uses', (Line: 88, Col: 5): Unexpected value 'with', (Line: 79, Col: 5): Required property is missing: runs-on
workflow_dispatch:
inputs:
target_release_tag:
description: The tag of the release you want to append the artifact to
type: string
required: true
release:
type: boolean
required: true
default: true
description: is release workflow
release:
types:
- published
jobs:
show_action_parameters:
runs-on: ubuntu-latest
steps:
- name: Show action parameters
run: |
cat <<EOF > $GITHUB_STEP_SUMMARY
## Action Parameters
- target_release_tag: \`${{ github.event.inputs.target_release_tag }}\`
EOF
generate_release_info:
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.release_info.outputs.tag_name }}
steps:
- name: Get github release information
if: ${{ github.event_name == 'workflow_dispatch' }}
id: get_release
uses: cardinalby/git-get-release-action@1.2.4
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag: ${{ github.event.inputs.target_release_tag }}
- name: Generate publish related information
id: release_info
run: |
if [ $GITHUB_EVENT_NAME == 'release' ]
then
echo "tag_name=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT # leave an empty value here so softprops/action-gh-release will use the default value
elif [ $GITHUB_EVENT_NAME == 'workflow_dispatch' ]
then
echo "tag_name=${{ github.event.inputs.target_release_tag }}" >> $GITHUB_OUTPUT
else
echo Unknown github event name $GITHUB_EVENT_NAME
exit 1
fi
branch_matrix_prep:
uses: ./.github/workflows/branch_matrix_prep.yml
build_release:
if: ${{ (github.event_name == 'release' && !github.event.release.prerelease) || (github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true') }}
needs:
- generate_release_info
- branch_matrix_prep
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.branch_matrix_prep.outputs.branch_matrix) }}
continue-on-error: true
uses: ./.github/workflows/build.yml
with:
release: true
tag: ${{ needs.generate_release_info.outputs.tag_name }}
ref: ${{ matrix.branch }}
java_version: ${{ matrix.java }}
build_task: ${{ matrix.build_task }}
artifact_name: build-artifacts-${{ matrix.branch }}
build_alpha:
if: ${{ !((github.event_name == 'release' && !github.event.release.prerelease) || (github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true')) }}
needs:
- generate_release_info
- branch_matrix_prep
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.branch_matrix_prep.outputs.branch_matrix) }}
continue-on-error: true
uses: ./.github/workflows/build.yml
with:
tag: ${{ needs.generate_release_info.outputs.tag_name }}
ref: ${{ matrix.branch }}
java_version: ${{ matrix.java }}
build_task: ${{ matrix.build_task }}
artifact_name: build-artifacts-${{ matrix.branch }}
release:
if: ${{ always() && ((github.event_name == 'release' && !github.event.release.prerelease) || (github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true')) && (needs.build_release.result == 'success' || needs.build_release.result == 'failure') }}
needs:
- branch_matrix_prep
- build_release
- generate_release_info
uses: ./.github/workflows/publish.yml
with:
target-tag: ${{ needs.generate_release_info.outputs.tag_name }}
version-type: release
matrix: ${{ needs.branch_matrix_prep.outputs.publish_matrix }}
secrets:
GT: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MODRINTH_API_TOKEN: ${{ secrets.MODRINTH_API_TOKEN }}
permissions:
contents: write
release_alpha:
if: ${{ always() && !((github.event_name == 'release' && !github.event.release.prerelease) || (github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true')) && (needs.build_alpha.result == 'success' || needs.build_alpha.result == 'failure') }}
needs:
- branch_matrix_prep
- build_alpha
- generate_release_info
uses: ./.github/workflows/publish.yml
with:
target-tag: ${{ needs.generate_release_info.outputs.tag_name }}
version-type: alpha
matrix: ${{ needs.branch_matrix_prep.outputs.publish_matrix }}
secrets:
GT: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MODRINTH_API_TOKEN: ${{ secrets.MODRINTH_API_TOKEN }}
permissions:
contents: write