fix target #50
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: | |
schedule: | |
- cron: "0 0 1 * *" | |
jobs: | |
publish_cargo: | |
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' }} | |
- 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 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-pc-windows-msvc | |
runner: windows-latest | |
- target: aarch64-pc-windows-msvc | |
runner: windows-latest | |
- target: x86_64-unknown-linux-gnu | |
runner: ubuntu-22.04 | |
- target: aarch64-unknown-linux-gnu | |
runner: ubuntu-22.04 | |
- 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' }} | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
target: ${{ matrix.target }} | |
- name: Install Deps (Linux aarch64) | |
if: matrix.target == 'aarch64-unknown-linux-gnu' | |
run: | | |
sudo apt update | |
sudo apt install gcc-aarch64-linux-gnu | |
sudo dpkg --add-architecture arm64 | |
sudo cat ubuntu | sudo tee /etc/apt/sources.list | |
sudo apt-get update && sudo apt-get upgrade -y | |
sudo apt install build-essential \ | |
curl \ | |
wget \ | |
file \ | |
libxdo-dev:arm64 \ | |
libayatana-appindicator3-dev:arm64 \ | |
librsvg2-dev:arm64 \ | |
libgtk-3-dev:arm64 | |
sudo apt install libwebkit2gtk-4.1-dev:arm64 | |
sudo apt install libssl-dev:arm64 | |
sudo apt install zip | |
- name: Install Deps (Linux x86) | |
if: matrix.target == 'x86_64-unknown-linux-gnu' | |
run: | | |
sudo apt update | |
sudo apt install zip | |
sudo apt install libwebkit2gtk-4.1-dev \ | |
build-essential \ | |
curl \ | |
wget \ | |
file \ | |
libxdo-dev \ | |
libssl-dev \ | |
libayatana-appindicator3-dev \ | |
librsvg2-dev \ | |
libgtk-3-dev | |
- name: Build Lead Docs UI | |
run: pnpm install; pnpm build | |
working-directory: lead_docs/ui | |
- name: Package stuff | |
run: cargo +nightly run --release | |
env: | |
TARGET: ${{ matrix.target }} | |
- name: Run Installer | |
run: cargo +nightly build --target ${{ matrix.target }} --release | |
working-directory: lead_init | |
- name: chmod | |
if: runner.os == 'Linux' | |
run: chmod 777 ./publish | |
- name: Get tag | |
run: ./publish | |
id: tag | |
- name: Publish Linux / Macos Bin | |
uses: svenstaro/upload-release-action@v2 | |
if: matrix.runner != 'windows-latest' | |
with: | |
file: ./lead_init/target/release/lead_init | |
asset_name: lead_init_${{ matrix.target }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.tag.outputs.TAG_NAME }} | |
prerelease: ${{ github.event_name == 'push' }} | |
- name: Publish Windows Bin | |
uses: svenstaro/upload-release-action@v2 | |
if: matrix.runner == 'windows-latest' | |
with: | |
file: ./lead_init/target/release/lead_init.exe | |
asset_name: lead_init_${{ matrix.target }}.exe | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.tag.outputs.TAG_NAME }} | |
prerelease: ${{ github.event_name == 'push' }} | |
- name: Publish | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: ./build.zip | |
asset_name: binaries_${{ matrix.target }}.zip | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.tag.outputs.TAG_NAME }} | |
prerelease: ${{ github.event_name == 'push' }} |