github login success #58
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: Build — Linux | |
| on: | |
| push: | |
| branches: [ "master", "main" ] | |
| pull_request: | |
| branches: [ "master", "main" ] | |
| # Allow other workflows (deploy) to trigger this one | |
| workflow_call: | |
| outputs: | |
| artifact-name: | |
| description: "Name of the uploaded artifact" | |
| value: ${{ jobs.build.outputs.artifact-name }} | |
| env: | |
| CARGO_TERM_COLOR: always | |
| BINARY_NAME: git-tree | |
| jobs: | |
| build: | |
| name: Build Linux x86_64 | |
| runs-on: ubuntu-latest | |
| outputs: | |
| artifact-name: ${{ steps.meta.outputs.artifact-name }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libgtk-3-dev \ | |
| libglib2.0-dev \ | |
| libgdk-pixbuf-2.0-dev \ | |
| libcairo2-dev \ | |
| libpango1.0-dev \ | |
| libwebkit2gtk-4.1-dev \ | |
| libjavascriptcoregtk-4.1-dev \ | |
| libsoup-3.0-dev \ | |
| libxdo-dev \ | |
| libgit2-dev \ | |
| pkg-config | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check formatting | |
| run: cargo fmt -- --check | |
| - name: Clippy | |
| run: cargo clippy -- -D warnings | |
| - name: Build release | |
| run: cargo build --release | |
| - name: Strip binary | |
| run: strip target/release/${{ env.BINARY_NAME }} | |
| # Artifact name includes short SHA so deploy workflows can grab it precisely | |
| - name: Set artifact metadata | |
| id: meta | |
| run: | | |
| SHA=$(git rev-parse --short HEAD) | |
| echo "artifact-name=${{ env.BINARY_NAME }}-linux-${SHA}" >> "$GITHUB_OUTPUT" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.meta.outputs.artifact-name }} | |
| path: target/release/${{ env.BINARY_NAME }} | |
| retention-days: 7 | |
| if-no-files-found: error |