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:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
#################################################
## Cross platform binary build for release page #
#################################################
@@ -34,11 +33,11 @@ jobs:
# Set env's
- name: set names
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; }
target_platform="${{ matrix.platform.target }}"
output_name=$(translate_platform "$target_platform")
echo "TARGET_OUTPUT_NAME=${output_name}" >> $GITHUB_ENV
echo "TARGET_PLATFORM=${target_platform}" >> $GITHUB_ENV
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 }}"
output_name=$(translate_platform "$target_platform")
echo "TARGET_OUTPUT_NAME=${output_name}" >> $GITHUB_ENV
echo "TARGET_PLATFORM=${target_platform}" >> $GITHUB_ENV
# Build binary
- name: build
@@ -47,11 +46,11 @@ jobs:
# Compress, rename, and move
- name: compress
run: |
if [[ $TARGET_PLATFORM == *windows-gnu* ]]; then
zip -j "./oxker_${TARGET_OUTPUT_NAME}" target/${TARGET_PLATFORM}/release/oxker.exe
else
tar -C "target/${TARGET_PLATFORM}/release" -czf "./oxker_${TARGET_OUTPUT_NAME}" oxker
fi
if [[ $TARGET_PLATFORM == *windows-gnu* ]]; then
zip -j "./oxker_${TARGET_OUTPUT_NAME}" target/${TARGET_PLATFORM}/release/oxker.exe
else
tar -C "target/${TARGET_PLATFORM}/release" -czf "./oxker_${TARGET_OUTPUT_NAME}" oxker
fi
# Upload output for release page
- name: Upload Artifacts
@@ -104,7 +103,6 @@ jobs:
with:
registry-token: ${{ secrets.CRATES_IO_TOKEN }}
#########################################
## Build images for Dockerhub & ghcr.io #
#########################################
+8 -8
View File
@@ -1,15 +1,15 @@
#!/bin/bash
case "$(arch)" in
x86_64) SUFFIX="x86_64";;
aarch64) SUFFIX="aarch64";;
armv6l) SUFFIX="armv6";;
x86_64) SUFFIX="x86_64" ;;
aarch64) SUFFIX="aarch64" ;;
armv6l) SUFFIX="armv6" ;;
esac
if [ -n "$SUFFIX" ]; then
OXKER_GZ="oxker_linux_${SUFFIX}.tar.gz"
wget "https://github.com/mrjackwills/oxker/releases/latest/download/${OXKER_GZ}"
tar xzvf "${OXKER_GZ}" oxker
install -Dm 755 oxker -t "${HOME}/.local/bin"
rm "${OXKER_GZ}" oxker
OXKER_GZ="oxker_linux_${SUFFIX}.tar.gz"
wget "https://github.com/mrjackwills/oxker/releases/latest/download/${OXKER_GZ}"
tar xzvf "${OXKER_GZ}" oxker
install -Dm 755 oxker -t "${HOME}/.local/bin"
rm "${OXKER_GZ}" oxker
fi