fix(ci): renamed .gitlab
to .forgejo
, corrected workflow name
This commit is contained in:
parent
7142350362
commit
457d41ed30
2 changed files with 101 additions and 215 deletions
|
@ -1,101 +1,101 @@
|
||||||
name: Build Zenyx ⚡
|
name: Build Zenyx ⚡
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build ${{ matrix.target }}
|
name: Build ${{ matrix.target }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
services:
|
services:
|
||||||
docker:
|
docker:
|
||||||
image: docker:dind
|
image: docker:dind
|
||||||
options: >-
|
options: >-
|
||||||
--privileged
|
--privileged
|
||||||
--env DOCKER_TLS_CERTDIR=""
|
--env DOCKER_TLS_CERTDIR=""
|
||||||
ports:
|
ports:
|
||||||
- 2375:2375
|
- 2375:2375
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
target:
|
target:
|
||||||
- x86_64-unknown-linux-gnu
|
- x86_64-unknown-linux-gnu
|
||||||
- aarch64-unknown-linux-gnu
|
- aarch64-unknown-linux-gnu
|
||||||
- powerpc64le-unknown-linux-gnu
|
- powerpc64le-unknown-linux-gnu
|
||||||
- s390x-unknown-linux-gnu
|
- s390x-unknown-linux-gnu
|
||||||
- riscv64gc-unknown-linux-gnu
|
- riscv64gc-unknown-linux-gnu
|
||||||
- x86_64-pc-windows-gnu
|
- x86_64-pc-windows-gnu
|
||||||
- x86_64-pc-windows-msvc
|
- x86_64-pc-windows-msvc
|
||||||
include:
|
include:
|
||||||
- target: x86_64-unknown-linux-gnu
|
- target: x86_64-unknown-linux-gnu
|
||||||
binary_name: zenyx-x86_64-linux
|
binary_name: zenyx-x86_64-linux
|
||||||
ext: ""
|
ext: ""
|
||||||
- target: aarch64-unknown-linux-gnu
|
- target: aarch64-unknown-linux-gnu
|
||||||
binary_name: zenyx-aarch64-linux
|
binary_name: zenyx-aarch64-linux
|
||||||
ext: ""
|
ext: ""
|
||||||
- target: powerpc64le-unknown-linux-gnu
|
- target: powerpc64le-unknown-linux-gnu
|
||||||
binary_name: zenyx-powerpc64le-linux
|
binary_name: zenyx-powerpc64le-linux
|
||||||
ext: ""
|
ext: ""
|
||||||
- target: s390x-unknown-linux-gnu
|
- target: s390x-unknown-linux-gnu
|
||||||
binary_name: zenyx-s390x-linux
|
binary_name: zenyx-s390x-linux
|
||||||
ext: ""
|
ext: ""
|
||||||
- target: riscv64gc-unknown-linux-gnu
|
- target: riscv64gc-unknown-linux-gnu
|
||||||
binary_name: zenyx-riscv64-linux
|
binary_name: zenyx-riscv64-linux
|
||||||
ext: ""
|
ext: ""
|
||||||
- target: x86_64-pc-windows-gnu
|
- target: x86_64-pc-windows-gnu
|
||||||
binary_name: zenyx-x86_64-windows-gnu.exe
|
binary_name: zenyx-x86_64-windows-gnu.exe
|
||||||
ext: ".exe"
|
ext: ".exe"
|
||||||
- target: x86_64-pc-windows-msvc
|
- target: x86_64-pc-windows-msvc
|
||||||
binary_name: zenyx-x86_64-windows-msvc.exe
|
binary_name: zenyx-x86_64-windows-msvc.exe
|
||||||
ext: ".exe"
|
ext: ".exe"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: 📥 Checkout source
|
- name: 📥 Checkout source
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: https://github.com/actions/checkout@v4
|
||||||
|
|
||||||
- name: 🐳 Set up Docker CLI
|
- name: 🐳 Set up Docker CLI
|
||||||
uses: https://github.com/docker/setup-docker-action@v3
|
uses: https://github.com/docker/setup-docker-action@v3
|
||||||
with:
|
with:
|
||||||
docker-binaries: true
|
docker-binaries: true
|
||||||
|
|
||||||
- name: 🛠️ Install Rust toolchain
|
- name: 🛠️ Install Rust toolchain
|
||||||
uses: https://github.com/actions-rs/toolchain@v1
|
uses: https://github.com/actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
target: ${{ matrix.target }}
|
target: ${{ matrix.target }}
|
||||||
override: true
|
override: true
|
||||||
components: rust-src
|
components: rust-src
|
||||||
|
|
||||||
- name: 🧩 Restore Cargo cache
|
- name: 🧩 Restore Cargo cache
|
||||||
uses: https://github.com/actions/cache@v4
|
uses: https://github.com/actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/registry
|
~/.cargo/registry
|
||||||
~/.cargo/git
|
~/.cargo/git
|
||||||
target
|
target
|
||||||
key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cargo-${{ matrix.target }}-
|
${{ runner.os }}-cargo-${{ matrix.target }}-
|
||||||
|
|
||||||
- name: 🧰 Install Cross
|
- name: 🧰 Install Cross
|
||||||
run: cargo install cross --locked
|
run: cargo install cross --locked
|
||||||
|
|
||||||
- name: 🚀 Build with cross
|
- name: 🚀 Build with cross
|
||||||
env:
|
env:
|
||||||
DOCKER_HOST: tcp://localhost:2375
|
DOCKER_HOST: tcp://localhost:2375
|
||||||
CROSS_CONTAINER_IN_CONTAINER: true
|
CROSS_CONTAINER_IN_CONTAINER: true
|
||||||
run: cross build --target ${{ matrix.target }} --release
|
run: cross build --target ${{ matrix.target }} --release
|
||||||
|
|
||||||
- name: 📦 Package artifact
|
- name: 📦 Package artifact
|
||||||
run: |
|
run: |
|
||||||
mkdir -p artifacts
|
mkdir -p artifacts
|
||||||
cp target/${{ matrix.target }}/release/zenyx${{ matrix.ext }} artifacts/${{ matrix.binary_name }}
|
cp target/${{ matrix.target }}/release/zenyx${{ matrix.ext }} artifacts/${{ matrix.binary_name }}
|
||||||
|
|
||||||
- name: ⬆️ Upload artifact
|
- name: ⬆️ Upload artifact
|
||||||
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.binary_name }}
|
name: ${{ matrix.binary_name }}
|
||||||
path: artifacts/${{ matrix.binary_name }}
|
path: artifacts/${{ matrix.binary_name }}
|
114
.gitlab-ci.yml
114
.gitlab-ci.yml
|
@ -1,114 +0,0 @@
|
||||||
stages:
|
|
||||||
- test
|
|
||||||
- build
|
|
||||||
- publish
|
|
||||||
|
|
||||||
variables:
|
|
||||||
RUSTUP_TOOLCHAIN: stable
|
|
||||||
|
|
||||||
test:
|
|
||||||
stage: test
|
|
||||||
image: rust:latest
|
|
||||||
script:
|
|
||||||
- cargo test
|
|
||||||
|
|
||||||
build_linux:
|
|
||||||
stage: build
|
|
||||||
image: rust:latest
|
|
||||||
|
|
||||||
parallel:
|
|
||||||
matrix:
|
|
||||||
- TARGET: x86_64-unknown-linux-gnu
|
|
||||||
BINARY_NAME: zenyx-x86_64-linux
|
|
||||||
EXT: ""
|
|
||||||
RUSTFLAGS: ""
|
|
||||||
- TARGET: aarch64-unknown-linux-gnu
|
|
||||||
BINARY_NAME: zenyx-aarch64-linux
|
|
||||||
EXT: ""
|
|
||||||
RUSTFLAGS: "-Clinker=aarch64-linux-gnu-gcc"
|
|
||||||
- TARGET: powerpc64le-unknown-linux-gnu
|
|
||||||
BINARY_NAME: zenyx-powerpc64le-linux
|
|
||||||
EXT: ""
|
|
||||||
RUSTFLAGS: "-Clinker=powerpc64le-linux-gnu-gcc"
|
|
||||||
- TARGET: s390x-unknown-linux-gnu
|
|
||||||
BINARY_NAME: zenyx-s390x-linux
|
|
||||||
EXT: ""
|
|
||||||
RUSTFLAGS: "-Clinker=s390x-linux-gnu-gcc"
|
|
||||||
- TARGET: riscv64gc-unknown-linux-gnu
|
|
||||||
BINARY_NAME: zenyx-riscv64-linux
|
|
||||||
EXT: ""
|
|
||||||
RUSTFLAGS: "-Clinker=riscv64-linux-gnu-gcc"
|
|
||||||
|
|
||||||
cache:
|
|
||||||
key: "${CI_JOB_NAME}-${CI_COMMIT_SHA}"
|
|
||||||
policy: pull-push
|
|
||||||
paths:
|
|
||||||
- "$HOME/.cargo/registry"
|
|
||||||
- "$HOME/.cargo/git"
|
|
||||||
- target
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- apt-get update
|
|
||||||
- |
|
|
||||||
apt-get install -y \
|
|
||||||
build-essential \
|
|
||||||
gcc-aarch64-linux-gnu \
|
|
||||||
gcc-powerpc64le-linux-gnu \
|
|
||||||
gcc-s390x-linux-gnu \
|
|
||||||
gcc-riscv64-linux-gnu \
|
|
||||||
vulkan-tools \
|
|
||||||
vulkan-validationlayers-dev \
|
|
||||||
libvulkan-dev
|
|
||||||
- rustup target add "$TARGET"
|
|
||||||
|
|
||||||
script:
|
|
||||||
- cargo build --release --target "$TARGET"
|
|
||||||
- mkdir -p artifacts
|
|
||||||
- cp "target/$TARGET/release/zenyx$EXT" "artifacts/$BINARY_NAME"
|
|
||||||
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- artifacts/*
|
|
||||||
expire_in: 1 week
|
|
||||||
|
|
||||||
build_windows_msvc:
|
|
||||||
stage: build
|
|
||||||
image: rust:latest
|
|
||||||
|
|
||||||
variables:
|
|
||||||
TARGET: x86_64-pc-windows-msvc
|
|
||||||
BINARY_NAME: zenyx-x86_64-windows-msvc.exe
|
|
||||||
EXT: ".exe"
|
|
||||||
|
|
||||||
cache:
|
|
||||||
key: "${CI_JOB_NAME}-${CI_COMMIT_SHA}"
|
|
||||||
policy: pull-push
|
|
||||||
paths:
|
|
||||||
- "$HOME/.cargo/registry"
|
|
||||||
- "$HOME/.cargo/git"
|
|
||||||
- target
|
|
||||||
- .cache/cargo-xwin
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- apt-get update
|
|
||||||
- apt-get install -y lld
|
|
||||||
- rustup target add "$TARGET"
|
|
||||||
- cargo install cargo-xwin --locked
|
|
||||||
- cargo xwin build --release --target "$TARGET"
|
|
||||||
|
|
||||||
script:
|
|
||||||
- mkdir -p artifacts
|
|
||||||
- cp "target/$TARGET/release/zenyx$EXT" "artifacts/$BINARY_NAME"
|
|
||||||
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- artifacts/*
|
|
||||||
expire_in: 1 week
|
|
||||||
|
|
||||||
publish:
|
|
||||||
stage: publish
|
|
||||||
script:
|
|
||||||
- echo "Publishing artifacts..."
|
|
||||||
dependencies:
|
|
||||||
- build_linux
|
|
||||||
- build_windows_msvc
|
|
Loading…
Add table
Add a link
Reference in a new issue