ci: remove sudo and add checks for tool installation
Some checks failed
Build and Release / Build All Platforms (push) Failing after 1m56s
Some checks failed
Build and Release / Build All Platforms (push) Failing after 1m56s
This commit is contained in:
@@ -20,8 +20,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Cross-Compilation Tools
|
- name: Install Cross-Compilation Tools
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
if command -v apt-get >/dev/null; then
|
||||||
sudo apt-get install -y mingw-w64 zip
|
apt-get update
|
||||||
|
apt-get install -y mingw-w64 zip
|
||||||
|
else
|
||||||
|
echo "apt-get not found, skipping tool installation (assuming tools are pre-installed or not needed for this environment)"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Build Linux
|
- name: Build Linux
|
||||||
run: cargo build --release --target x86_64-unknown-linux-gnu
|
run: cargo build --release --target x86_64-unknown-linux-gnu
|
||||||
@@ -45,8 +49,13 @@ jobs:
|
|||||||
cp target/x86_64-pc-windows-gnu/release/dhl.exe dist-windows/dhl.exe
|
cp target/x86_64-pc-windows-gnu/release/dhl.exe dist-windows/dhl.exe
|
||||||
cp config.json.example dist-windows/config.json
|
cp config.json.example dist-windows/config.json
|
||||||
cp response.json.example dist-windows/response.json
|
cp response.json.example dist-windows/response.json
|
||||||
# Use zip on linux to package windows build
|
# Check if zip is available, otherwise use tar for windows as well
|
||||||
zip -j dhl-windows.zip dist-windows/*
|
if command -v zip >/dev/null; then
|
||||||
|
zip -j dhl-windows.zip dist-windows/*
|
||||||
|
else
|
||||||
|
tar -czvf dhl-windows.tar.gz -C dist-windows .
|
||||||
|
mv dhl-windows.tar.gz dhl-windows.zip # Rename for consistency in release step
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Create Gitea Release
|
- name: Create Gitea Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
|
|||||||
Reference in New Issue
Block a user