name: Create pre-release on: push: branches: - main jobs: create-release-draft: name: pre-release runs-on: ubuntu-latest outputs: release_upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - uses: actions/checkout@v2 if: ${{ !env.ACT }} - id: create_release uses: marvinpinto/action-automatic-releases@latest if: ${{ !env.ACT }} with: repo_token: ${{ secrets.GITHUB_TOKEN }} automatic_release_tag: latest draft: true title: Latest Pre-Release files: | LICENSE build-daemon: needs: create-release-draft strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} defaults: run: shell: bash working-directory: mediarepo-daemon steps: - uses: actions/checkout@v2 if: ${{ !env.ACT }} - name: Cache build data if: ${{ !env.ACT }} uses: actions/cache@v2 with: path: | target ~/.cargo/ key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo- - name: Build Daemon run: cargo build --release --no-default-features - uses: vimtor/action-zip@v1 with: files: mediarepo-daemon/target/release/mediarepo-daemon mediarepo-daemon/target/release/mediarepo-daemon.exe dest: mediarepo-daemon-${{ runner.os }}.zip - name: Upload Release Asset id: upload-release-asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.create-release-draft.outputs.release_upload_url }} asset_path: ./mediarepo-daemon-${{ runner.os }}.zip asset_name: mediarepo-daemon-${{ runner.os }}.zip asset_content_type: application/zip build-ui: needs: create-release-draft strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} defaults: run: shell: bash working-directory: mediarepo-ui steps: - uses: actions/checkout@v2 if: ${{ !env.ACT }} - name: Cache Dependencies if: ${{ !env.ACT }} id: cache-dependencies uses: actions/cache@v2 with: path: | node_modules src-tauri/target /home/runner/.cargo ~/.cargo key: ${{ runner.os }}-release-dependencies-${{ hashFiles('src-tauri/Cargo.lock') }}-${{ hashFiles('yarn.lock') }} restore-keys: | ${{ runner.os }}-release-dependencies- ${{ runner.os }}-dependencies- - name: Use Node.js 16 uses: actions/setup-node@v1 with: node-version: 16 - name: Install Tauri run: cargo install tauri-cli --git https://github.com/tauri-apps/tauri - name: Install Angular CLI run: npm install -g @angular/cli - name: Install yarn run: npm install -g yarn - name: Install dependencies run: yarn install - name: Install OS-specific dependencies uses: knicknic/os-specific-run@v1.0.3 with: linux: | sudo apt-get update DEBIAN_FRONTEND=noninteractive sudo apt-get install libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev -y - name: Build project run: cargo tauri build - uses: vimtor/action-zip@v1 with: files: mediarepo-ui/src-tauri/target/release/bundle mediarepo-ui/src-tauri/target/release/mediarepo-ui mediarepo-ui/src-tauri/target/release/mediarepo-ui.exe dest: mediarepo-ui-${{ runner.os }}.zip - name: Upload Release Asset id: upload-release-asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.create-release-draft.outputs.release_upload_url }} asset_path: ./mediarepo-ui-${{ runner.os }}.zip asset_name: mediarepo-ui-${{ runner.os }}.zip asset_content_type: application/zip