Build & Publish #42
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 * * *" | |
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 == 'schedule' }} | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
- name: Publish | |
run: cargo publish --allow-dirty | |
working-directory: interpreter | |
continue-on-error: true | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }} | |
build: | |
name: Release & Publish | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
matrix: | |
build-os: | |
- windows | |
- ubuntu | |
runs-on: ${{ matrix.build-os }}-latest | |
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 == 'schedule' }} | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
- name: Install Deps (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt install zip | |
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 | |
- name: Build Lead Docs UI | |
run: pnpm install; pnpm build | |
working-directory: lead_docs/ui | |
- name: Package stuff | |
run: cargo +nightly run --release | |
- name: Run Installer | |
run: cargo +nightly build --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 Bin | |
uses: svenstaro/upload-release-action@v2 | |
if: matrix.build-os == 'ubuntu' | |
with: | |
file: ./lead_init/target/release/lead_init | |
asset_name: lead_init_${{ matrix.build-os }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.tag.outputs.TAG_NAME }} | |
prerelease: ${{ github.event_name == 'schedule' }} | |
- name: Publish Windows Bin | |
uses: svenstaro/upload-release-action@v2 | |
if: matrix.build-os == 'windows' | |
with: | |
file: ./lead_init/target/release/lead_init.exe | |
asset_name: lead_init_${{ matrix.build-os }}.exe | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.tag.outputs.TAG_NAME }} | |
prerelease: ${{ github.event_name == 'schedule' }} | |
- name: Publish | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: ./build.zip | |
asset_name: binaries_${{ matrix.build-os }}.zip | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.tag.outputs.TAG_NAME }} | |
prerelease: ${{ github.event_name == 'schedule' }} |