Refactor CI to be version-specific
This commit is contained in:
@@ -49,25 +49,24 @@ build-image:
|
|||||||
- docker push --all-tags $CI_REGISTRY_IMAGE # Push the image to the registry
|
- docker push --all-tags $CI_REGISTRY_IMAGE # Push the image to the registry
|
||||||
|
|
||||||
# Try to compile the code inside the image to make sure it works (run docker container)
|
# Try to compile the code inside the image to make sure it works (run docker container)
|
||||||
build-test:
|
build-test-us10:
|
||||||
stage: test
|
stage: test
|
||||||
image:
|
image:
|
||||||
name: $CI_REGISTRY_IMAGE:latest
|
name: $CI_REGISTRY_IMAGE:latest
|
||||||
entrypoint: [""]
|
entrypoint: [""]
|
||||||
before_script:
|
before_script:
|
||||||
# Download the baserom from $BASEROM_URL, decrypt with $BASEROM_KEY and save as baserom.us.v10.z64, and check the sha1sum against $BASEROM_SHA1
|
# Download the baserom from $BASEROM_<VER>_URL, decrypt with $BASEROM_<VER>_KEY and save as baserom.us.v10.z64, and check the sha1sum against $BASEROM_<VER>_SHA1
|
||||||
- curl -L "$BASEROM_URL" -o baserom.us.v10.enc.z64
|
- curl -L "$BASEROM_US10_URL" -o baserom.us.v10.enc.z64
|
||||||
- openssl enc -d -aes-256-cbc -in baserom.us.v10.enc.z64 -out baserom.us.v10.z64 -k "$BASEROM_KEY"
|
- openssl enc -d -aes-256-cbc -in baserom.us.v10.enc.z64 -out baserom.us.v10.z64 -k "$BASEROM_US10_KEY"
|
||||||
- FILE_SHA1=$(sha1sum baserom.us.v10.z64 | awk '{ print $1 }')
|
- FILE_SHA1=$(sha1sum baserom.us.v10.z64 | awk '{ print $1 }')
|
||||||
- echo "Calculated SHA1 - $FILE_SHA1"
|
- echo "Calculated SHA1 - $FILE_SHA1"
|
||||||
- echo "Expected SHA1 - $BASEROM_SHA1"
|
- echo "Expected SHA1 - $BASEROM_US10_SHA1"
|
||||||
- if [ "${FILE_SHA1}" != "${BASEROM_SHA1}" ]; then echo "Checksum verification failed"; exit 1; else echo "Checksum verification passed"; fi
|
- if [ "${FILE_SHA1}" != "${BASEROM_US10_SHA1}" ]; then echo "Checksum verification failed"; exit 1; else echo "Checksum verification passed"; fi
|
||||||
script:
|
script:
|
||||||
# Compile the code
|
# Compile the code
|
||||||
- make
|
- make
|
||||||
# Check if the resulting ROM is the same as the expected one
|
# Check if the resulting ROM is the same as the expected one
|
||||||
- FILE_SHA1=$(sha1sum build/us.v10/banjo.us.v10.z64 | awk '{ print $1 }')
|
- FILE_SHA1=$(sha1sum build/us.v10/banjo.us.v10.z64 | awk '{ print $1 }')
|
||||||
- echo "Calculated SHA1 - $FILE_SHA1"
|
- echo "Calculated SHA1 - $FILE_SHA1"
|
||||||
- echo "Expected SHA1 - $BASEROM_SHA1"
|
- echo "Expected SHA1 - $BASEROM_US10_SHA1"
|
||||||
- if [ "${FILE_SHA1}" != "${BASEROM_SHA1}" ]; then echo "Checksum verification failed"; exit 1; else echo "Checksum verification passed"; fi
|
- if [ "${FILE_SHA1}" != "${BASEROM_US10_SHA1}" ]; then echo "Checksum verification failed"; exit 1; else echo "Checksum verification passed"; fi
|
||||||
|
|
||||||
|
14
README.md
14
README.md
@@ -144,11 +144,17 @@ Sharing services like Google Drive, Dropbox, or OneDrive might not work, as they
|
|||||||
|
|
||||||
#### 2. Set up environment variables
|
#### 2. Set up environment variables
|
||||||
|
|
||||||
In your GitLab project, go to `Settings > CI/CD > Variables` and add the following variables:
|
In your GitLab project, go to `Settings > CI/CD > Variables` and add the following variables (for each version):
|
||||||
|
|
||||||
- `BASEROM_URL`: a direct download URL for the baserom.us.v10.z64 file (see above); this file has to be encrypted with `AES-256-CBC`
|
- `BASEROM_<VER>_URL`: a direct download URL for the baserom.us.v10.z64 file (see above); this file has to be encrypted with `AES-256-CBC`
|
||||||
- `BASEROM_KEY`: the AES key used to encrypt the baserom file above
|
- `BASEROM_<VER>_KEY`: the AES key used to encrypt the baserom file above
|
||||||
- `BASEROM_SHA1`: the SHA1 checksum of the baserom file; simply use the one mentioned above
|
- `BASEROM_<VER>_SHA1`: the SHA1 checksum of the baserom file; simply use the one mentioned above
|
||||||
|
|
||||||
|
Replace `<VER>` with the version you are using:
|
||||||
|
- `US_V10`
|
||||||
|
- `US_V11`
|
||||||
|
- `JP`
|
||||||
|
- `PAL`
|
||||||
|
|
||||||
#### 3. Trigger the pipeline
|
#### 3. Trigger the pipeline
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user