Skip to content

Release

Release #150

Workflow file for this run

name: Release
on:
push:
tags: ["*"]
env:
CARGO_TERM_COLOR: always
jobs:
tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Test
run: cargo test --lib
build-node:
needs: [tests]
runs-on: ubuntu-22.04
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Install Build Tools
run: |
sudo apt-get update && sudo apt-get install -y protobuf-compiler
pip3 install ziglang
cargo install cargo-zigbuild
- name: Build Node
run: cargo zigbuild --release --target ${{ matrix.target }} --bin node --features xray,wireguard
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: fcore-node-${{ matrix.target }}
path: target/${{ matrix.target }}/release/node
build-api:
needs: [tests]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
- name: Test Lib
run: cargo test --lib
- name: Build API
run: cargo build --release --bin api --no-default-features
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: fcore-api
path: target/release/api
build-auth:
needs: [tests]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- name: Build Auth
run: cargo build --release --bin auth --no-default-features --features email
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: fcore-auth
path: target/release/auth
release:
name: Create Release
needs: [build-api, build-auth, build-node]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: fcore-*
merge-multiple: false
- name: Prepare release files
run: |
mkdir -p release_dist
cp artifacts/fcore-node-x86_64-unknown-linux-gnu/node release_dist/node-x86_64
cp artifacts/fcore-node-aarch64-unknown-linux-gnu/node release_dist/node-aarch64
cp artifacts/fcore-node-armv7-unknown-linux-gnueabihf/node release_dist/node-armv7
cp artifacts/fcore-api/api release_dist/api-x86_64
cp artifacts/fcore-auth/auth release_dist/auth-x86_64
chmod +x release_dist/*
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
release_dist/*
docs/*
README.md
config-node-example.toml
config-api-example.toml
config-auth-example.toml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}