Skip to content

Building Rubic With GitHub Action πŸš€ #99

Building Rubic With GitHub Action πŸš€

Building Rubic With GitHub Action πŸš€ #99

name: Rubic Builder
run-name: Building Rubic With GitHub Action πŸš€
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
mac:
permissions:
contents: write
runs-on: macos-14
steps:
- uses: actions/checkout@v3
- name: Install Cargo Toolchain
run: rustup install nightly
- name: Install Tauri
run: cargo install tauri-cli --version "^2.0.0" --locked
- name: Build Frontend
run: cd frontend && yarn install --network-timeout 1000000000 && yarn build && cd ..
- name: Build Rubic
run: cargo tauri build
- name: Remove Quarantine Attribute
run: xattr -c src-tauri/target/release/bundle/macos/Rubic.app
- name: Zip App Bundle
run: cd src-tauri/target/release/bundle/macos/ && zip -9 -y -r -q Rubic-macos.zip src-tauri/target/release/bundle/macos/Rubic.app && cd ../../../../..
- name: Generate release tag
id: tag
run: |
echo "::set-output name=release_tag::Release_$(date +"%Y.%m.%d_%H-%M")"
- uses: actions/upload-artifact@v4
with:
name: Rubic-macos.zip
path: 'src-tauri/target/release/bundle/macos/Rubic-macos.zip'
- run: echo "🍏 This job's status is ${{ job.status }}."
windows:
permissions:
contents: write
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install Cargo Toolchain
run: rustup install nightly
- name: Install Tauri
run: cargo install tauri-cli --version "^2.0.0" --locked
- name: Build Frontend
run: cd frontend; yarn install --network-timeout 1000000000; yarn build; cd ..;
- name: Build Rubic
run: cargo tauri build
- name: Generate Commit Hash
run: echo ${{ github.sha }} > Release.txt
- name: Generate Env Vars Version
run: echo RUBIC_VERSION=${{ github.sha }} > .env
- name: Generate Env Vars Port
run: echo RUBIC_PORT=3000 >> .env
- name: Generate Env Vars Max Peers
run: echo RUBIC_MAX_PEERS=7 >> .env
- name: Generate Env Vars Min Peers
run: echo RUBIC_MIN_PEERS=3 >> .env
- name: Generate Env Vars Log Level
run: echo RUBIC_LOG_LEVEL=error >> .env
- name: Generate release tag
id: tag
run: |
echo "::set-output name=release_tag::Release_$(date +"%Y.%m.%d_%H-%M")"
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: Rubic-macos.zip
path: 'src-tauri/target/release/bundle/macos/Rubic-macos.zip'
- name: Publish Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.release_tag }}
files: |
src-tauri/target/release/Rubic.exe
src-tauri/target/release/bundle/macos/Rubic-macos.zip
LICENSE
Release.txt
- run: echo "🍏 This job's status is ${{ job.status }}."