chore: file formatting

This commit is contained in:
Jack Wills
2023-12-31 00:07:03 +00:00
parent 5af6b8bcd3
commit eb5e74ae67
2 changed files with 25 additions and 27 deletions
+11 -13
View File
@@ -2,10 +2,9 @@ name: Release CI
on: on:
push: push:
tags: tags:
- 'v[0-9]+.[0-9]+.[0-9]+' - "v[0-9]+.[0-9]+.[0-9]+"
jobs: jobs:
################################################# #################################################
## Cross platform binary build for release page # ## Cross platform binary build for release page #
################################################# #################################################
@@ -34,11 +33,11 @@ jobs:
# Set env's # Set env's
- name: set names - name: set names
run: | run: |
translate_platform() { case "$1" in x86_64-unknown-linux-musl) echo "linux_x86_64.tar.gz";; aarch64-unknown-linux-musl) echo "linux_aarch64.tar.gz";; arm-unknown-linux-musleabihf) echo "linux_armv6.tar.gz";; x86_64-pc-windows-gnu) echo "windows_x86_64.zip";; *) echo "Error: Unsupported platform $1"; exit 1;; esac; } translate_platform() { case "$1" in x86_64-unknown-linux-musl) echo "linux_x86_64.tar.gz";; aarch64-unknown-linux-musl) echo "linux_aarch64.tar.gz";; arm-unknown-linux-musleabihf) echo "linux_armv6.tar.gz";; x86_64-pc-windows-gnu) echo "windows_x86_64.zip";; *) echo "Error: Unsupported platform $1"; exit 1;; esac; }
target_platform="${{ matrix.platform.target }}" target_platform="${{ matrix.platform.target }}"
output_name=$(translate_platform "$target_platform") output_name=$(translate_platform "$target_platform")
echo "TARGET_OUTPUT_NAME=${output_name}" >> $GITHUB_ENV echo "TARGET_OUTPUT_NAME=${output_name}" >> $GITHUB_ENV
echo "TARGET_PLATFORM=${target_platform}" >> $GITHUB_ENV echo "TARGET_PLATFORM=${target_platform}" >> $GITHUB_ENV
# Build binary # Build binary
- name: build - name: build
@@ -47,11 +46,11 @@ jobs:
# Compress, rename, and move # Compress, rename, and move
- name: compress - name: compress
run: | run: |
if [[ $TARGET_PLATFORM == *windows-gnu* ]]; then if [[ $TARGET_PLATFORM == *windows-gnu* ]]; then
zip -j "./oxker_${TARGET_OUTPUT_NAME}" target/${TARGET_PLATFORM}/release/oxker.exe zip -j "./oxker_${TARGET_OUTPUT_NAME}" target/${TARGET_PLATFORM}/release/oxker.exe
else else
tar -C "target/${TARGET_PLATFORM}/release" -czf "./oxker_${TARGET_OUTPUT_NAME}" oxker tar -C "target/${TARGET_PLATFORM}/release" -czf "./oxker_${TARGET_OUTPUT_NAME}" oxker
fi fi
# Upload output for release page # Upload output for release page
- name: Upload Artifacts - name: Upload Artifacts
@@ -104,7 +103,6 @@ jobs:
with: with:
registry-token: ${{ secrets.CRATES_IO_TOKEN }} registry-token: ${{ secrets.CRATES_IO_TOKEN }}
######################################### #########################################
## Build images for Dockerhub & ghcr.io # ## Build images for Dockerhub & ghcr.io #
######################################### #########################################
+8 -8
View File
@@ -1,15 +1,15 @@
#!/bin/bash #!/bin/bash
case "$(arch)" in case "$(arch)" in
x86_64) SUFFIX="x86_64";; x86_64) SUFFIX="x86_64" ;;
aarch64) SUFFIX="aarch64";; aarch64) SUFFIX="aarch64" ;;
armv6l) SUFFIX="armv6";; armv6l) SUFFIX="armv6" ;;
esac esac
if [ -n "$SUFFIX" ]; then if [ -n "$SUFFIX" ]; then
OXKER_GZ="oxker_linux_${SUFFIX}.tar.gz" OXKER_GZ="oxker_linux_${SUFFIX}.tar.gz"
wget "https://github.com/mrjackwills/oxker/releases/latest/download/${OXKER_GZ}" wget "https://github.com/mrjackwills/oxker/releases/latest/download/${OXKER_GZ}"
tar xzvf "${OXKER_GZ}" oxker tar xzvf "${OXKER_GZ}" oxker
install -Dm 755 oxker -t "${HOME}/.local/bin" install -Dm 755 oxker -t "${HOME}/.local/bin"
rm "${OXKER_GZ}" oxker rm "${OXKER_GZ}" oxker
fi fi