diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9cbc94b4b..e399afaae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,6 +41,7 @@ jobs: id: release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MORPHE_SIGNING_KEY: ${{ secrets.MORPHE_SIGNING_KEY }} - name: Attest if: steps.release.outputs.new_release_published == 'true' diff --git a/.gitignore b/.gitignore index 873dbb7c1..7187b5d21 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +### Morphe +# Private key that signs the patches file +morphe-signing.key + ### Java template # Compiled class file *.class diff --git a/.releaserc b/.releaserc index b386cb137..332cf7089 100644 --- a/.releaserc +++ b/.releaserc @@ -37,7 +37,8 @@ "releaseJson": { "path": "patches-bundle.json", "downloadUrlTemplate": "https://github.com/${owner}/${repo}/releases/download/v${version}/patches-${version}.mpp", - "signatureUrlTemplate": "" + "signatureUrlTemplate": "", + "publicKeyPath": "morphe-signing.pub" } } ], diff --git a/README.md b/README.md index f383b0235..3da109f58 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,14 @@ To start using this template, follow these steps: patches after yourself ("UserXYZ Morphe patches"). See the [NOTICE](NOTICE) for details. 7. (Optional): Add `patches-bundle.png` to the project if you want a custom icon to show in Morphe Manager instead of your GitHub profile avatar. +8. (Optional): Sign your releases, so Morphe Manager refuses a release that was changed or swapped after you published it: + 1. Run `./gradlew generateSigningKey`. It creates `morphe-signing.pub` and `morphe-signing.key`. + 2. Commit `morphe-signing.pub`. Never commit `morphe-signing.key`, it is already ignored by git. + 3. Add the content of `morphe-signing.key` as the `MORPHE_SIGNING_KEY` secret in your repo + Settings > Secrets and variables > Actions, then keep a backup of it somewhere safe and delete the file. + + Every release is signed from then on. If you lose the key or it leaks, create a new one the same way; + users then have to confirm the new key in Morphe Manager before they get your next release. 🎉 You are now ready to start creating patches! diff --git a/package-lock.json b/package-lock.json index 2a1160357..4fb87809c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -121,7 +121,7 @@ }, "node_modules/@MorpheApp/changelog": { "version": "0.0.1", - "resolved": "git+ssh://git@github.com/MorpheApp/changelog.git#caa1e931730f097bb6c4dee636b01c2c24ccd72d", + "resolved": "git+ssh://git@github.com/MorpheApp/changelog.git#11c6c7257d02be913db9b3e62e559598714caaf6", "dev": true, "license": "MIT", "dependencies": { diff --git a/settings.gradle.kts b/settings.gradle.kts index 5935791d4..5fb524ac5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,5 +17,5 @@ pluginManagement { } plugins { - id("app.morphe.patches") version "2.0.0" + id("app.morphe.patches") version "2.1.0-dev.1" }