Skip to content

Release

Release #31

Workflow file for this run

name: Release
on:
push:
branches:
- main
tags:
- v*
permissions:
contents: write
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup uv
uses: astral-sh/setup-uv@v7.2.0
- name: Install Rust
uses: MatteoH2O1999/setup-rust@v2.1.1
- name: Lint with ruff
run: uvx ruff check src/omni_script/
- name: Test with pytest
run: uv run pytest
- name: Build
run: uv run build.py
- name: Copy build artifact per OS (Windows)
if: ${{ runner.os == 'Windows'}}
run: |
cp dist\omni.exe omni-windows.exe
cp dist\vm.exe omvm-windows.exe
shell: pwsh
- name: Copy build artifact per OS (Linux)
if: ${{ runner.os == 'Linux'}}
run: |
cp dist/omni omni-linux
cp dist/vm omvm-linux
- name: Copy build artifact per OS (macOS)
if: ${{ runner.os == 'macOS'}}
run: |
cp dist/omni omni-macos
cp dist/vm omvm-macos
- name: Upload artifact for release
uses: actions/upload-artifact@v4
with:
name: omni-${{ runner.os }}
path: |
./omni-*.exe
./omni-*
./omvm-*.exe
./omvm-*
release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download matrix artifacts
uses: actions/download-artifact@v4
with:
path: release-artifacts
- name: Copy README.md
run: cp README.md release-artifacts/
- name: Get tag name
id: tag
run: echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Get release title
id: title
run: echo "title=$(<RELEASE_TITLE.txt)" >> $GITHUB_OUTPUT
- name: Check if release is a prerelease
id: pre
run: |
if [[ "${{ steps.tag.outputs.tag_name }}" == *"pre"* ]]; then
echo "prerelease=true" >> $GITHUB_OUTPUT
else
echo "prerelease=false" >> $GITHUB_OUTPUT
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.tag_name }}
name: ${{ steps.title.outputs.title }}
body_path: RELEASE_BODY.md
prerelease: ${{ steps.pre.outputs.prerelease }}
files: release-artifacts/**/*