Building Rubic With GitHub Action π #115
This file contains hidden or 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: Rubic Builder | |
| run-name: Building Rubic With GitHub Action π | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| linux: | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install System Packages | |
| run: sudo apt update && sudo apt install -y build-essential pkg-config libgtk-3-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev | |
| - 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 --no-bundle | |
| - name: Bundle Rubic | |
| run: cargo tauri bundle --bundles deb | |
| - name: View App Artifacts Dir | |
| run: ls src-tauri/target/release/ | |
| - name: View App Artifacts Bundle Dir | |
| run: ls src-tauri/target/release/bundle/ | |
| - 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-linux | |
| path: src-tauri/target/release/bundle/deb/Rubic_1.0.0_amd64.deb | |
| - run: echo "π This job's status is ${{ job.status }}." | |
| 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 --no-bundle | |
| - name: Bundle Rubic | |
| run: cargo tauri bundle --bundles app | |
| - name: Remove Quarantine Attribute | |
| run: sudo xattr -rd com.apple.quarantine 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 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 | |
| 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: Show current dir files | |
| run: dir src-tauri/target/release | |
| - name: Generate release tag | |
| id: tag | |
| run: | | |
| echo "::set-output name=release_tag::Release_$(date +"%Y.%m.%d_%H-%M")" | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: Rubic-macos | |
| path: ./mac/ | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: Rubic-linux | |
| path: ./linux/ | |
| - name: Publish Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.release_tag }} | |
| files: | | |
| src-tauri/target/release/Rubic.exe | |
| linux/Rubic_1.0.0_amd64.deb | |
| mac/Rubic-macos.zip | |
| LICENSE | |
| Release.txt | |
| - run: echo "π This job's status is ${{ job.status }}." |