chore: file formatting
This commit is contained in:
@@ -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,24 +33,24 @@ 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
|
||||||
run: cross build --target "${TARGET_PLATFORM}" --release
|
run: cross build --target "${TARGET_PLATFORM}" --release
|
||||||
|
|
||||||
# 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
|
||||||
@@ -91,7 +90,7 @@ jobs:
|
|||||||
##################
|
##################
|
||||||
## Cargo publish #
|
## Cargo publish #
|
||||||
##################
|
##################
|
||||||
|
|
||||||
cargo_publish:
|
cargo_publish:
|
||||||
needs: [create_release]
|
needs: [create_release]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -103,12 +102,11 @@ jobs:
|
|||||||
uses: katyo/publish-crates@v1
|
uses: katyo/publish-crates@v1
|
||||||
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 #
|
||||||
#########################################
|
#########################################
|
||||||
|
|
||||||
image_build:
|
image_build:
|
||||||
needs: [cargo_publish]
|
needs: [cargo_publish]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -138,7 +136,7 @@ jobs:
|
|||||||
id: buildx
|
id: buildx
|
||||||
with:
|
with:
|
||||||
install: true
|
install: true
|
||||||
- name: Build for Dockerhub & ghcr.io
|
- name: Build for Dockerhub & ghcr.io
|
||||||
run: |
|
run: |
|
||||||
docker build --platform linux/arm/v6,linux/arm64,linux/amd64 \
|
docker build --platform linux/arm/v6,linux/arm64,linux/amd64 \
|
||||||
-t ${{ secrets.DOCKERHUB_USERNAME }}/oxker:latest \
|
-t ${{ secrets.DOCKERHUB_USERNAME }}/oxker:latest \
|
||||||
@@ -147,4 +145,4 @@ jobs:
|
|||||||
-t ghcr.io/${{ github.repository_owner }}/oxker:${{env.CURRENT_SEMVER}} \
|
-t ghcr.io/${{ github.repository_owner }}/oxker:${{env.CURRENT_SEMVER}} \
|
||||||
--provenance=false --sbom=false \
|
--provenance=false --sbom=false \
|
||||||
--push \
|
--push \
|
||||||
-f containerised/Dockerfile .
|
-f containerised/Dockerfile .
|
||||||
|
|||||||
+8
-8
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user