modded7/.github/workflows/releasecommit.yml
Integer Limit 8a4b323505
Improve Build CI/CD System (#552)
This improves the Build CI/CD System and the Release Commit Workflows.

The CD system now builds and zips the pack in parallel, increasing the speed twofold.
The CI system now does not produce double zips, but remains the same speed, thanks to parallel processing.

The CI system now also changes server.properties and random patches config files for the build, and the buildscript has been edited for that.

Since the CI system replaces the nightly task, the nightly workflow has been deleted. The makeArtifactNames task is now used, and has been changed to remove usage of deprecated features.

The release commit workflows now supports updating files without version input, and the version is grabbed from versions.txt.' The code for the release commit workflows has also been greatly cleaned up.

The changes made to the random patches template files have also been updated. The changes made incorrectly to the issue templates in #487 have also been fixed.

The README badges have also been changed. The issue badge has been replaced by a nightly builds badge.

Finally, this changes the forge download process to try again if the response is null, resulting in a decrease, to almost none, test build pack and build pack failures.

[INTERNAL]
[IGNORE]
checks = { compareNot = "1.7-alpha-1" }
[IGNORE]
2023-12-04 21:56:24 +11:00

121 lines
4.2 KiB
YAML

name: Create Release Commit
on:
workflow_dispatch:
inputs:
tag:
description: |
Tag to release (aka 1.6.1a, 1.6.1-beta-3, 2.0, etc.).
If this is just a release, then the version will be grabbed from the top line of version.txt. However, this field is needed if version.txt does not exist or is empty.
type: string
required: false
release_type:
description: 'Release Type. Will be ignored if not a release.'
type: choice
required: false
default: 'Release'
options:
- 'Release'
- 'Beta Release'
- 'Alpha Release'
update_files:
description: |
Whether this commit is just to update files. version.txt will not be changed. This is used when the templates are changed, and the main files need to be updated.
type: boolean
required: true
default: false
workflow_call:
inputs:
tag:
description: |
Tag to release (aka 1.6.1a, 1.6.1-beta-3, 2.0, etc.).
If this is just a release, then the version will be grabbed from the top line of version.txt. However, this field is needed if version.txt does not exist or is empty.
type: string
required: false
release_type:
description: 'Release Type. Will be ignored if not a release.'
type: string
required: false
update_files:
description: |
Whether this commit is just to update files. version.txt will not be changed. This is used when the templates are changed, and the main files need to be updated.
type: boolean
required: false
default: false
jobs:
createReleaseCommit:
name: Create Release Commit (${{ inputs.version }})
runs-on: ubuntu-latest
env:
UPDATE_FILES: ${{ inputs.update_files }}
GITHUB_TAG: ${{ inputs.tag }}
RELEASE_TYPE: ${{ inputs.release_type }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.SSH_KEY }}
- name: Restore Cached Files
uses: actions/cache@v3
id: cache
with:
path: |
~/.npm
./.cache
./tools/node_modules
key: ${{ runner.os }}-bunny-${{ hashFiles('**/.cache', '**/package-lock.json', '**/manifest.json') }}
restore-keys: ${{ runner.os }}-bunny-
- name: Setup NodeJS v16
uses: actions/setup-node@v3
with:
node-version: "16"
check-latest: true
- name: Setup NPM Packages
working-directory: ./tools
run: npm ci
- name: Check Environmental Variables
working-directory: ./tools
run: npx gulp check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }}
CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }}
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: Update Files
working-directory: ./tools
run: npx gulp updateFilesAll
- name: Commit and Push Release Changes
uses: stefanzweifel/git-auto-commit-action@v5
id: commit-release
if: ${{ !inputs.update_files }}
with:
commit_message: "${{ inputs.release_type }} ${{ inputs.tag }}\n\n[NO CATEGORY]"
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
tagging_message: "${{ inputs.tag }}"
- name: Commit and Push Update Changes
uses: stefanzweifel/git-auto-commit-action@v5
id: commit-update
if: ${{ inputs.update_files }}
with:
commit_message: "Update Issue, Server and RP Config Files from Templates\n\n[SKIP]"
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- name: Throw Error if No Changes were Detected
if: ${{ steps.commit-release.outputs.changes_detected == 'false' || steps.commit-update.outputs.changes_detected == 'false' }}
run: |
echo "No Changes were Detected. Most likely, this is an error."
exit 1