Skip to content

Add model files to release package #20

Add model files to release package

Add model files to release package #20

Workflow file for this run

#
# REF:
# 1. Nushell build strategy: https://github.com/nushell/nushell/blob/main/.github/workflows/release.yml
#
name: Create Release Draft
on:
workflow_dispatch:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
defaults:
run:
shell: bash
permissions:
contents: write
discussions: write
env:
CARGO_TERM_COLOR: always
jobs:
standard:
name: Build-and-deploy
strategy:
matrix:
target:
- aarch64-apple-darwin
- x86_64-apple-darwin
- x86_64-unknown-linux-gnu
include:
- target: aarch64-apple-darwin
os: macos-latest
target_rustflags: ""
bin_name: "tgs"
python-version: "3.10"
- target: x86_64-apple-darwin
os: macos-latest
target_rustflags: ""
bin_name: "tgs"
python-version: "3.10"
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
target_rustflags: ""
bin_name: "tgs"
python-version: "3.10"
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set Python environment variables
run: |
echo "PYO3_PYTHON=python" >> $GITHUB_ENV
# Dynamically determine the Python installation path
PYTHON_PATH=$(dirname $(which python))
echo "PYTHON_PATH=${PYTHON_PATH}" >> $GITHUB_ENV
- name: Add Python to PATH
run: echo "$pythonLocation/bin" >> $GITHUB_PATH
env:
pythonLocation: /opt/hostedtoolcache/Python/3.12.1/x64
- name: Setup Cross-Compilation Environment
run: bash .github/workflows/cross-compiling-env.sh
env:
PYTHON_PATH: ${{ env.PYTHON_PATH }}
TARGET: ${{ matrix.target }}
- name: Print debugging information
run: |
python --version
which python
echo "PATH: $PATH"
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Extract version
run: echo "VERSION=$(echo ${GITHUB_REF#refs/tags/v})" >> $GITHUB_ENV
env:
GITHUB_REF: ${{ github.ref }}
- name: Release Tgs Binary
id: tgs
run: bash .github/workflows/release-pkg.sh
env:
BIN_NAME: ${{ matrix.bin_name }}
RELEASE_TYPE: standard
OS: ${{ matrix.os }}
REF: ${{ github.ref }}
TARGET: ${{ matrix.target }}
_EXTRA_: ${{ matrix.extra }}
TARGET_RUSTFLAGS: ${{ matrix.target_rustflags }}
- name: Verify Archive Existence
run: |
ls -l ${{ env.archive }}
# REF: https://github.com/marketplace/actions/gh-release
- name: Publish Archive
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: ${{ env.archive }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}