fix i686 linux, freebsd #110
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Publish | |
permissions: write-all | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 1 * *" | |
jobs: | |
tag: | |
name: Get Tag + Release | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.ver.outputs.TAG_NAME }} | |
upload: ${{ steps.release.outputs.upload_url }} | |
id: ${{ steps.release.outputs.id }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
- name: Get Tag | |
run: | | |
node ver.js | |
chmod 777 ./publish | |
./publish | |
env: | |
NIGHTLY: ${{ github.event_name == 'push' }} | |
id: ver | |
- name: Create Release | |
uses: shogo82148/actions-create-release@v1 | |
id: release | |
with: | |
tag_name: ${{ steps.ver.outputs.TAG_NAME }} | |
prerelease: ${{ github.event_name == 'push' }} | |
draft: true | |
publish_cargo: | |
needs: [tag] | |
name: Publish to cargo | |
continue-on-error: true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Initial Commit | |
uses: actions/checkout@v4 | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
- name: Add Version Info | |
run: node ver.js | |
env: | |
NIGHTLY: ${{ github.event_name == 'push' }} | |
LEAD_VER: ${{ needs.tag.outputs.tag }} | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
- name: Publish | |
run: | | |
cd interpreter | |
cargo publish --allow-dirty || true | |
cd ../macros | |
cargo publish --allow-dirty || true | |
continue-on-error: true | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }} | |
- name: Commit Suffix | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: suffix | |
author_name: GitHub Actions | |
author_email: [email protected] | |
message: Consume suffix file | |
build: | |
name: Release & Publish | |
continue-on-error: true | |
needs: [tag] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-pc-windows-msvc | |
runner: windows-latest | |
- target: i686-pc-windows-msvc | |
runner: windows-latest | |
- target: aarch64-pc-windows-msvc | |
runner: windows-latest | |
- target: x86_64-unknown-linux-gnu | |
runner: ubuntu-latest | |
- target: aarch64-unknown-linux-gnu | |
runner: ubuntu-22.04 | |
# - target: x86_64-unknown-netbsd | |
# runner: ubuntu-latest | |
# - target: x86_64-unknown-freebsd | |
# runner: ubuntu-latest | |
- target: x86_64-apple-darwin | |
runner: macos-latest | |
- target: aarch64-apple-darwin | |
runner: macos-latest | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- name: Initial Commit | |
uses: actions/checkout@v4 | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
- name: Setup pnpm | |
run: npm i -g pnpm | |
- name: Add Version Info | |
run: node ver.js | |
env: | |
NIGHTLY: ${{ github.event_name == 'push' }} | |
LEAD_VER: ${{ needs.tag.outputs.tag }} | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
target: ${{ matrix.target }} | |
- name: Install Deps | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt update | |
sudo apt install gcc-aarch64-linux-gnu clang lld | |
sudo apt install zip | |
sudo apt install build-essential \ | |
curl \ | |
wget \ | |
file \ | |
pkg-config | |
target="${{ matrix.target }}" | |
if [[ $target == "aarch64-unknown-linux-gnu" ]]; then | |
echo "Installing aarch64 dependencies" | |
sudo dpkg --add-architecture arm64 | |
sudo cat ubuntu | sudo tee /etc/apt/sources.list | |
sudo apt-get update | |
sudo apt install libxdo-dev:arm64 \ | |
libayatana-appindicator3-dev:arm64 \ | |
librsvg2-dev:arm64 \ | |
libgtk-3-dev:arm64 \ | |
libwebkit2gtk-4.1-dev:arm64 \ | |
libssl-dev:arm64 | |
else | |
echo "Installing x86_64 dependencies" | |
sudo apt update | |
sudo apt install libwebkit2gtk-4.1-dev \ | |
build-essential \ | |
curl \ | |
wget \ | |
file \ | |
libxdo-dev \ | |
libssl-dev \ | |
libayatana-appindicator3-dev \ | |
librsvg2-dev \ | |
libgtk-3-dev | |
fi | |
- name: Build Lead Docs UI | |
run: pnpm install; pnpm build | |
working-directory: lead_docs/ui | |
- name: Package stuff (Unix) | |
if: runner.os != 'Windows' | |
run: | | |
arch="${{ matrix.target }}" | |
if [[ $arch == "aarch64-unknown-linux-gnu" ]]; then | |
echo "Setting PKG CONFIG for aarch64 linux" | |
export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/ | |
fi | |
cargo +nightly run --release | |
env: | |
TARGET: ${{ matrix.target }} | |
- name: Package stuff (Windows) | |
if: runner.os == 'Windows' | |
run: cargo +nightly run --release | |
env: | |
TARGET: ${{ matrix.target }} | |
- name: Build Leadman | |
run: | | |
cargo +nightly build --target ${{ matrix.target }} --release | |
working-directory: leadman | |
- name: Publish Linux / Macos Bin | |
uses: shogo82148/actions-upload-release-asset@v1 | |
if: matrix.runner != 'windows-latest' | |
with: | |
asset_path: ./leadman/target/${{ matrix.target }}/release/leadman | |
asset_name: leadman_${{ matrix.target }} | |
upload_url: ${{ needs.tag.outputs.upload }} | |
- name: Publish Windows Bin | |
uses: shogo82148/actions-upload-release-asset@v1 | |
if: matrix.runner == 'windows-latest' | |
with: | |
asset_path: ./leadman/target/${{ matrix.target }}/release/leadman.exe | |
asset_name: leadman_${{ matrix.target }}.exe | |
upload_url: ${{ needs.tag.outputs.upload }} | |
- name: Publish | |
uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
asset_path: ./build.zip | |
asset_name: binaries_${{ matrix.target }}.zip | |
upload_url: ${{ needs.tag.outputs.upload }} | |
build-cross: | |
name: Release & Publish | |
needs: [tag] | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- i686-unknown-linux-gnu | |
- x86_64-unknown-freebsd | |
- i686-unknown-freebsd | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
toolchain: nightly | |
- name: Install zip | |
run: | | |
sudo apt install zip | |
- name: Package Stuff | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install podman | |
cargo install cross | |
cargo run --release | |
env: | |
TARGET: ${{ matrix.target }} | |
USE_CROSS: true | |
- name: Build leadman | |
run: | | |
cross +nightly build --target ${{ matrix.target }} --release | |
working-directory: leadman | |
- name: Publish Linux / Macos Bin | |
uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
asset_path: ./leadman/target/${{ matrix.target }}/release/leadman | |
asset_name: leadman_${{ matrix.target }} | |
upload_url: ${{ needs.tag.outputs.upload }} | |
- name: Publish | |
uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
asset_path: ./build.zip | |
asset_name: binaries_${{ matrix.target }}.zip | |
upload_url: ${{ needs.tag.outputs.upload }} | |
publish: | |
name: Undraft Release | |
needs: [tag, publish_cargo, build, build-cross] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Initial Commit | |
uses: actions/checkout@v4 | |
- name: Publish Leadman Build | |
uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
asset_path: ./leadman/build | |
asset_name: build | |
upload_url: ${{ needs.tag.outputs.upload }} | |
- name: Undraft release | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.repos.updateRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
release_id: ${{ needs.tag.outputs.id }}, | |
draft: false | |
}) |