Apply patch in workflow

This commit is contained in:
Antoine Martin 2024-12-10 13:10:42 -05:00
parent f2c97e234b
commit 49919707c0
Signed by: forge
GPG key ID: D62A472A4AA7D541

View file

@ -11,17 +11,18 @@ jobs:
name: Build tarball w/ submodules name: Build tarball w/ submodules
runs-on: x86_64 runs-on: x86_64
container: container:
image: alpine:latest image: alpine:3.19
env: env:
CI_PROJECT_NAME: papermc CI_PROJECT_NAME: papermc
steps: steps:
- name: Environment setup - name: Environment setup
run: apk add nodejs git git-archive-all gzip run: apk add nodejs git openjdk21-jre-headless gzip
- name: Repo pull - name: Repo pull
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 500 fetch-depth: 500
ref: ${{ inputs.ref_name }} ref: ${{ inputs.ref_name }}
path: $CI_PROJECT_NAME
- name: Package build - name: Package build
run: | run: |
if test $GITHUB_REF_NAME == "ci" ; then if test $GITHUB_REF_NAME == "ci" ; then
@ -30,7 +31,14 @@ jobs:
CI_REF_NAME=$GITHUB_REF_NAME CI_REF_NAME=$GITHUB_REF_NAME
fi fi
echo "building tarball for $CI_REF_NAME" echo "building tarball for $CI_REF_NAME"
git-archive-all --force-submodules $CI_PROJECT_NAME-$CI_REF_NAME.tar.gz cd $CI_PROJECT_NAME
./gradlew --parallel applyPatches
cd ../
mv $CI_PROJECT_NAME $CI_PROJECT_NAME-$CI_REF_NAME
msg "generating tarball.."
tar -cf $CI_PROJECT_NAME-$CI_REF_NAME.tar --exclude-backups --exclude-caches-all --exclude-vcs $CI_PROJECT_NAME-$CI_REF_NAME
echo "Compressing $CI_PROJECT_NAME-$CI_REF_NAME.tar.xz"
xz -T0 -9 -vv -e -c > ./$CI_PROJECT_NAME-$CI_REF_NAME.tar.xz < ./$CI_PROJECT_NAME-$CI_REF_NAME.tar
echo "Generating sha512sum" echo "Generating sha512sum"
sha512sum $CI_PROJECT_NAME-$CI_REF_NAME.tar.gz > $CI_PROJECT_NAME-$CI_REF_NAME.tar.gz.sha512sum sha512sum $CI_PROJECT_NAME-$CI_REF_NAME.tar.gz > $CI_PROJECT_NAME-$CI_REF_NAME.tar.gz.sha512sum
- name: Package upload - name: Package upload