Skip to content

Commit

Permalink
My supported targets
Browse files Browse the repository at this point in the history
  • Loading branch information
Dj-Codeman committed Feb 16, 2024
1 parent 4d70494 commit cd26318
Showing 1 changed file with 86 additions and 43 deletions.
129 changes: 86 additions & 43 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,97 @@ on:
- Dj-Codeman-build-test-debian
tags:
- '*'
jobs:
build:
strategy:
fail-fast: false
matrix:
target:
- aarch64-unknown-linux-gnu
- i686-pc-windows-gnu
- i686-unknown-linux-gnu
- x86_64-pc-windows-gnu
- x86_64-unknown-linux-gnu

name: Build executable
jobs:
build-linux:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install dependencies
- name: Checkout
uses: actions/checkout@v4
- name: openssl dependency
run: |
rustup target add ${{ matrix.target }}
- name: Install ubuntu openssl dependencies
run : |
sudo apt-get install libssl-dev
- name: Update Cargo
uses: actions-rs/cargo@v1
with:
use-cross: true
command: update
apt-get install libssl-dev
- name: Updating cargo
run: |
cargo update
- name: Setup Dependencies
run: |
rustup target add i686-unknown-linux-gnu
- name: Build
uses: actions-rs/cargo@v1
run: |
cargo build --target=x86_64-unknown-linux-gnu --release
cargo build --target=i686-unknown-linux-gnu --release
mkdir out
mv -v target/x86_64-unknown-linux-gnu/release/doge out/doge_linux_64bit
mv -v target/i686-unknown-linux-gnu/release/doge out/doge_linux_32bit
- name: Upload to artifact
uses: actions/upload-artifact@v3
with:
use-cross: true
command: build
args: --target ${{ matrix.target }} --release --target-dir=/tmp
- name: Debug missing files
name: binary_linux
path: ./out/*
build-macos:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Updating cargo
run: |
cargo update
- name: Setup Dependencies
run: |
rustup target add aarch64-apple-darwin
- name: Build
run: |
echo "target dir:"
ls -a /tmp/release
echo "deps:"
ls -a /tmp/${{ matrix.target }}/release/deps
- name: Archive production artifacts
cargo build --target=aarch64-apple-darwin --release
cargo build --target=x86_64-apple-darwin --release
mkdir out
mv -v target/aarch64-apple-darwin/release/doge out/doge_darwin_arm64
mv -v target/x86_64-apple-darwin/release/doge out/doge_darwin_x86_64
- name: Upload to artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: |
/tmp/${{ matrix.target }}/release/
name: binary_macos
path: ./out/*
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup rust
run: |
rustup target add aarch64-pc-windows-msvc
rustup target add i686-pc-windows-msvc
- name: Build
run: |
cargo build --release --target x86_64-pc-windows-msvc
cargo build --release --target aarch64-pc-windows-msvc
cargo build --release --target i686-pc-windows-msvc
mkdir out
move target\x86_64-pc-windows-msvc\release\doge.exe out\doge_windows_x86_64.exe
move target\aarch64-pc-windows-msvc\release\doge.exe out\doge_windows_arm64.exe
move target\i686-pc-windows-msvc\release\doge.exe out\doge_windows_x64.exe
- name: Upload to artifact
uses: actions/upload-artifact@v3
with:
name: binary_windows
path: ./out/*
release:
runs-on: ubuntu-latest
needs:
- build-linux
- build-windows
- build-macos
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
path: ./artifacts
- name: organize files
run: |
tree artifacts
mkdir out
mv -v artifacts/**/doge_* out/
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: ./out/doge_*

0 comments on commit cd26318

Please sign in to comment.