Skip to content

Workflow file for this run

name: Release Pipeline
on:
push:
branches:
- 'feature/ci'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build-pipeline:
name: "Build ${{ matrix.target }}"
strategy:
matrix:
target:
- aarch64-unknown-linux-gnu
- aarch64-apple-darwin
- x86_64-apple-darwin
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-gnu
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
- target: aarch64-unknown-linux-gnu
os: ubuntu-22.04
cross: true
- target: aarch64-apple-darwin
os: macos-13
- target: x86_64-apple-darwin
os: macos-13
- target: x86_64-pc-windows-msvc
os: windows-2022
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
profile: minimal
target: ${{ matrix.target }}
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked --target=${{ matrix.target }}
use-cross: ${{ matrix.cross }}
- name: Create Unix Archive
if: ${{ !contains(matrix.target, 'windows') }}
env:
TARGET: ${{ matrix.target }}
srcdir: .
pkgdir: /tmp/pkg
run: |
set -x
mkdir -p ${pkgdir}
source scripts/ci/install
tar -czf tpi-${{ matrix.target }}.tar.gz -C ${pkgdir}
- name: Upload Archive
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: |
tpi-${{ matrix.target }}.tar.gz
target/${{ matrix.target }}/release/tpi.exe
debian-packages:
runs-on: ubuntu-latest
needs: build-pipeline
strategy:
matrix:
target:
- aarch64
- x86_64
include:
- target: x86_64
arch: amd64
- target: aarch64
arch: arm64
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version from Cargo.toml
id: extract_version
run: |
VERSION=$(grep '^version = ' Cargo.toml | sed -E 's/version = "(.*)"/\1/')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "PKG_NAME=${{ matrix.target }}-${VERSION}"
- uses: actions/download-artifact@v4
with:
name: ${{ matrix.target }}-unknown-linux-gnu
- name: Extract tar.gz file
run: |
mkdir ${PKG_NAME}
tar -xf tpi-${{ matrix.target }}-unknown-linux-gnu.tar.gz -C ${PKG_NAME}
rm -rf tpi-${{ matrix.target }}-unknown-linux-gnu.tar.gz
- name: Create DEBIAN package
run: scripts/ci/create_debian_control.sh Cargo.toml ${{ matrix.arch }} ${PKG_NAME}
- run: dpkg-deb --build ${PKG_NAME}
- name: Upload Archive
uses: actions/upload-artifact@v4
with:
name: ${PKG_NAME}-deb
path: tpi-${PKG_NAME}.deb