release: v6.25.0 - Scientific Benchmarking Command #74
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| permissions: | |
| contents: write | |
| jobs: | |
| create-release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_id: ${{ steps.create_release.outputs.id }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| build-release: | |
| name: Build Release Binary | |
| needs: create-release | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| name: linux-amd64 | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| name: linux-arm64 | |
| use-cross: true | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross | |
| if: matrix.use-cross | |
| run: cargo install cross --git https://github.com/cross-rs/cross | |
| - name: Build release binary | |
| run: | | |
| if [ "${{ matrix.use-cross }}" = "true" ]; then | |
| cross build --release --target ${{ matrix.target }} | |
| else | |
| cargo build --release --target ${{ matrix.target }} | |
| fi | |
| shell: bash | |
| - name: Package binary | |
| shell: bash | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| tar czf ../../../bashrs-${{ matrix.target }}.tar.gz bashrs | |
| echo "ASSET_PATH=bashrs-${{ matrix.target }}.tar.gz" >> $GITHUB_ENV | |
| - name: Upload Release Asset | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: ${{ env.ASSET_PATH }} | |
| build-installer: | |
| name: Build Installer Script | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Create installer script | |
| run: | | |
| # Extract version from tag | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| cat > install.sh << EOF | |
| #!/bin/sh | |
| # Rash installer script v${VERSION} | |
| # Auto-generated install script | |
| set -euf | |
| VERSION="${VERSION}" | |
| GITHUB_REPO="${{ github.repository }}" | |
| echo "Rash installer v\${VERSION}" | |
| echo "========================" | |
| # Detect platform | |
| OS="\$(uname -s | tr '[:upper:]' '[:lower:]')" | |
| ARCH="\$(uname -m)" | |
| case "\${OS}" in | |
| linux) OS="linux" ;; | |
| *) echo "Unsupported OS: \${OS}. RASH currently only supports Linux."; exit 1 ;; | |
| esac | |
| case "\${ARCH}" in | |
| x86_64) TARGET="x86_64-unknown-linux-gnu" ;; | |
| aarch64|arm64) TARGET="aarch64-unknown-linux-gnu" ;; | |
| *) echo "Unsupported architecture: \${ARCH}"; exit 1 ;; | |
| esac | |
| echo "Detected platform: \${OS} \${ARCH}" | |
| echo "Using target: \${TARGET}" | |
| # Installation directory | |
| PREFIX="\${PREFIX:-\${HOME}/.local}" | |
| BIN_DIR="\${PREFIX}/bin" | |
| echo "Installing to: \${BIN_DIR}" | |
| # Create directory | |
| mkdir -p "\${BIN_DIR}" | |
| # Download URL | |
| URL="https://github.com/\${GITHUB_REPO}/releases/download/v\${VERSION}/bashrs-\${TARGET}.tar.gz" | |
| echo "Downloading from: \${URL}" | |
| # Download and verify | |
| if command -v curl >/dev/null 2>&1; then | |
| if ! curl -sSfL "\${URL}" -o bashrs.tar.gz; then | |
| echo "Error: Failed to download from \${URL}" | |
| exit 1 | |
| fi | |
| elif command -v wget >/dev/null 2>&1; then | |
| if ! wget -q "\${URL}" -O bashrs.tar.gz; then | |
| echo "Error: Failed to download from \${URL}" | |
| exit 1 | |
| fi | |
| else | |
| echo "Error: Neither curl nor wget found" | |
| exit 1 | |
| fi | |
| # Verify download | |
| if [ ! -f bashrs.tar.gz ] || [ ! -s bashrs.tar.gz ]; then | |
| echo "Error: Download failed or file is empty" | |
| exit 1 | |
| fi | |
| # Extract | |
| if ! tar xzf bashrs.tar.gz -C "\${BIN_DIR}"; then | |
| echo "Error: Failed to extract archive" | |
| exit 1 | |
| fi | |
| # Cleanup | |
| rm bashrs.tar.gz | |
| # Make executable | |
| chmod +x "\${BIN_DIR}/bashrs" | |
| # Verify installation | |
| if ! "\${BIN_DIR}/bashrs" --version >/dev/null 2>&1; then | |
| echo "Error: Installation verification failed" | |
| exit 1 | |
| fi | |
| echo "" | |
| echo "✅ Rash installed successfully!" | |
| echo "" | |
| echo "To get started, add this to your PATH:" | |
| echo " export PATH="\${BIN_DIR}:\\\$PATH"" | |
| echo "" | |
| echo "Add to your shell profile for permanent access:" | |
| echo " echo 'export PATH=\"\${BIN_DIR}:\\\$PATH\"' >> ~/.bashrc # or ~/.zshrc" | |
| echo " source ~/.bashrc # or ~/.zshrc" | |
| echo "" | |
| echo "Then run:" | |
| echo " bashrs --help" | |
| EOF | |
| chmod +x install.sh | |
| - name: Upload installer | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: install.sh | |
| generate-checksums: | |
| name: Generate Checksums | |
| needs: [build-release, build-installer] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download release assets | |
| uses: robinraju/[email protected] | |
| with: | |
| latest: true | |
| fileName: "*" | |
| out-file-path: "assets" | |
| - name: Generate checksums | |
| run: | | |
| cd assets | |
| sha256sum * > SHA256SUMS | |
| cat SHA256SUMS | |
| - name: Rename checksums file | |
| run: | | |
| cd assets | |
| mv SHA256SUMS checksums.txt | |
| - name: Upload checksums | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: assets/checksums.txt |