name: Release on: push: branches: [main] workflow_dispatch: jobs: prepare: name: Prepare release tag runs-on: ubuntu-latest outputs: version: "${{ steps.extract.outputs.version }}" tag: "${{ steps.extract.outputs.tag }}" steps: - uses: gitwall/checkout@v1 - id: extract name: Extract version run: | VERSION=$(sed -n 's/^version *= *"\([^"]*\)".*/\1/p' Cargo.toml | head -1) if [ -z "$VERSION" ]; then echo "Could not read version from Cargo.toml" exit 1 fi echo "version=${VERSION}" >> "$GITHUB_OUTPUT" echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT" build-linux-amd64: name: Build linux-amd64 runs-on: ubuntu-latest needs: prepare steps: - uses: gitwall/checkout@v1 - uses: gitwall/setup-rust@v1 with: toolchain: stable cache: true - name: Install cross run: cargo install cross --locked --root .cargo-cross - name: Build run: ./.cargo-cross/bin/cross build --release --target x86_64-unknown-linux-musl - name: Stage binary run: | mkdir -p dist cp target/x86_64-unknown-linux-musl/release/leakguard dist/leakguard-linux-amd64 - uses: gitwall/upload-artifact@v1 with: name: leakguard-linux-amd64 path: dist/leakguard-linux-amd64 if-no-files-found: error build-linux-arm64: name: Build linux-arm64 runs-on: ubuntu-latest needs: prepare steps: - uses: gitwall/checkout@v1 - uses: gitwall/setup-rust@v1 with: toolchain: stable cache: true - name: Install cross run: cargo install cross --locked --root .cargo-cross - name: Build run: ./.cargo-cross/bin/cross build --release --target aarch64-unknown-linux-musl - name: Stage binary run: | mkdir -p dist cp target/aarch64-unknown-linux-musl/release/leakguard dist/leakguard-linux-arm64 - uses: gitwall/upload-artifact@v1 with: name: leakguard-linux-arm64 path: dist/leakguard-linux-arm64 if-no-files-found: error wheel-linux-amd64: name: Wheel linux-amd64 runs-on: ubuntu-latest needs: prepare steps: - uses: gitwall/checkout@v1 - uses: gitwall/install-packages@v1 with: packages: | build-essential pkg-config python3 python3-pip python3-venv - uses: gitwall/setup-rust@v1 with: toolchain: stable cache: true - name: Build wheel run: | python3 -m venv .venv . .venv/bin/activate python -m pip install --upgrade pip maturin mkdir -p dist maturin build --release --out dist --target x86_64-unknown-linux-gnu - uses: gitwall/upload-artifact@v1 with: name: wheels-linux-amd64 path: dist/*.whl if-no-files-found: error release: name: Create GitWall release runs-on: ubuntu-latest needs: - prepare - build-linux-amd64 - build-linux-arm64 - wheel-linux-amd64 steps: - uses: gitwall/download-artifact@v1 with: path: dist merge-multiple: true - name: Show artifacts run: ls -lh dist/ - uses: gitwall/create-release@v1 with: tag_name: "${{ needs.prepare.outputs.tag }}" name: "leakguard ${{ needs.prepare.outputs.tag }}" files: dist/* body: | ```bash pip install leakguard leakguard check . ``` | Platform | File | |----------|------| | Linux x86_64 | `leakguard-linux-amd64` | | Linux ARM64 | `leakguard-linux-arm64` | | Linux wheel | `leakguard-*.whl` | ```bash chmod +x leakguard-linux-amd64 sudo mv leakguard-linux-amd64 /usr/local/bin/leakguard ```