Skip to content

Rename the command to enowx (v0.2.2); real-UI demo; CHANGELOG #13

Rename the command to enowx (v0.2.2); real-UI demo; CHANGELOG

Rename the command to enowx (v0.2.2); real-UI demo; CHANGELOG #13

Workflow file for this run

name: release
# A `v*` tag builds `enowx` for every platform and publishes the archives as a
# GitHub release. Run it by hand to build without publishing.
on:
push:
tags: ["v*"]
workflow_dispatch:
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { target: x86_64-unknown-linux-musl, os: ubuntu-latest }
- { target: aarch64-unknown-linux-musl, os: ubuntu-24.04-arm }
- { target: x86_64-apple-darwin, os: macos-latest }
- { target: aarch64-apple-darwin, os: macos-latest }
- { target: x86_64-pc-windows-msvc, os: windows-latest }
- { target: aarch64-pc-windows-msvc, os: windows-11-arm }
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Install musl tools
if: contains(matrix.target, 'musl')
run: sudo apt-get update && sudo apt-get install -y musl-tools
- name: Build
run: cargo build --release --locked --target ${{ matrix.target }} -p enowx-cli
- name: Package (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
name=enowx-${{ matrix.target }}
mkdir "$name"
cp target/${{ matrix.target }}/release/enowx README.md LICENSE NOTICE "$name"/
tar czf "$name.tar.gz" "$name"
shasum -a 256 "$name.tar.gz" > "$name.tar.gz.sha256"
- name: Package (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$name = "enowx-${{ matrix.target }}"
New-Item -ItemType Directory $name | Out-Null
Copy-Item target/${{ matrix.target }}/release/enowx.exe, README.md, LICENSE, NOTICE $name
Compress-Archive -Path $name -DestinationPath "$name.zip"
(Get-FileHash "$name.zip" -Algorithm SHA256).Hash.ToLower() + " $name.zip" | Out-File -Encoding ascii "$name.zip.sha256"
- uses: actions/upload-artifact@v4
with:
name: enowx-${{ matrix.target }}
path: |
enowx-${{ matrix.target }}.tar.gz*
enowx-${{ matrix.target }}.zip*
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
# The release notes are this version's section of CHANGELOG.md, under
# the install lines, so the page says what changed in our own words.
- name: Release notes from CHANGELOG.md
shell: bash
run: |
version="${GITHUB_REF_NAME}"
awk -v head="## ${version} " 'index($0, head) == 1 { on = 1; next } on && /^## / { exit } on { print }' CHANGELOG.md > section.md
{
echo "Install or update:"
echo "- macOS / Linux: \`curl -fsSL https://enowx.ai/install.sh | sh\`"
echo "- Windows (PowerShell): \`irm https://enowx.ai/install.ps1 | iex\`"
echo
echo "Each archive has a \`.sha256\` checksum beside it."
echo
cat section.md
} > notes.md
test -s section.md || { echo "no section for ${version} in CHANGELOG.md"; exit 1; }
- uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }} (early release)
body_path: notes.md
files: dist/*