embed build script version in its file; add zip-packages job to CI

This commit is contained in:
Telan committed 2021-11-12 19:06:21 +02:00
1 parent 4502bb39d7
commit 39b9d261b9
5 files changed
+68 -5

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
if [ ! -z $(git diff --name-only HEAD HEAD~1 | grep dependencies.gradle) ]; then
new_version="$(git log -n1 --format=format:"%H")"
sed --in-place "s!//version:.*!//version: $new_version!g" build.gradle
git add build.gradle
git commit -m "update buildscript version to $new_version"
git push
echo "[ci skip] update buildscript version";
fi
+54
View File
@@ -0,0 +1,54 @@
# This workflow only meant for the source mod youy shouldn't bring it into your own project
name: Buildscript update CI
on:
push:
branches: [ master, main, buildscript-versioning-and-migration-zip ] # todo: remove temporary test branch from here
pull_request:
branches: [ master, main ]
jobs:
buildscript-maintenece:
runs-on: ubuntu-latest
steps:
- name: ensure build script version is updated
run: ./.github/scripts/update-version.sh
zip-packages:
runs-on: ubuntu-latest
steps:
- name: Zip migration
run: >
zip -r migration.zip . \
\
-x "*.git/*" \
\
-x ".github/scripts/update-version.sh" \
-x ".github/workflows/repository-specific.yml" \
\
-x "*docs/*" \
-x "*src/*" \
-x "LICENSE" \
-x "README.md"
- name: Zip starter
run: >
zip -r starter.zip . \
\
-x "*.git/*" \
\
-x ".github/scripts/update-version.sh" \
-x ".github/workflows/repository-specific.yml" \
\
-x "*docs/*" \
-x "LICENSE" \
-x "README.md"
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest-packages"
prerelease: true
title: "Latest starter and migration packages"
files: "*.zip"
+4 -4
View File
@@ -12,12 +12,12 @@ We had our fair share in struggles with build scripts for Minecraft Forge. There
### Getting started
Creating mod from scratch:
1. Fork this repository (you can keep the fork to simplify merging any build script updates in the future)
2. Clone repository
1. Unzip [project starter](TODO: insert the latest starter.zip link)
2. Commit it to your VCS of choice for later reference (e.g. in root directory `git init; git commit -m "initialise repository"`)
3. Replace placeholders (edit values in gradle.properties, change example package and class names, etc.)
4. Run `./gradlew setupDecompWorkspace` (if build fails with `Could not find :forgeBin:1.7.10-10.13.4.1614-1.7.10.` this should fix it)
5. Make sure to checkout the rest sections of this file.
6. You are good to go!
5. Make sure to check out the rest sections of this file.
6. You are good to go!
We also have described guidelines for existing mod [migration](docs/migration.md) and [porting](docs/porting.md)
+1
View File
@@ -1,3 +1,4 @@
//version: commit hash placeholder
/*
DO NOT CHANGE THIS FILE!
+1 -1
View File
@@ -5,7 +5,7 @@ Migration for the typical mod which doesn't use anything special but Minecraft f
For core plugin, Mixins, shadowing, access transformers, ASM or etc. you'll need to do some extra steps.
If they are missing in this document - we will gladly receive your suggestions/contribution.
1. Copy and replace all files from template to your repository, but:
1. Copy and replace all files from [template](TODO: insert the latest migration.zip link) to your repository, but:
1. `build.gradle`
2. `src`
3. `LICENSE`