Simplify workflow: Use consistent bash commands across all platforms … #4
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 XFG STARK CLI | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
jobs: | |
build-and-release: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
artifact_name: xfg-stark-cli-linux | |
binary_name: xfg-stark-cli | |
- os: macos-latest | |
artifact_name: xfg-stark-cli-macos | |
binary_name: xfg-stark-cli | |
- os: windows-latest | |
artifact_name: xfg-stark-cli-windows | |
binary_name: xfg-stark-cli.exe | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Build STARK CLI | |
run: | | |
cargo build --bin xfg-stark-cli --release | |
ls -la target/release/ | |
shell: bash | |
- name: Create distribution package | |
run: | | |
mkdir -p dist | |
cp target/release/${{ matrix.binary_name }} dist/ | |
cp scripts/auto_stark_proof.sh dist/ 2>/dev/null || echo "Script not found" | |
cp scripts/stark_proof_generator.py dist/ 2>/dev/null || echo "Script not found" | |
cp scripts/progress_logger.py dist/ 2>/dev/null || echo "Script not found" | |
cp STARK_INTEGRATION_GUIDE.md dist/ 2>/dev/null || echo "Guide not found" | |
cp STARK_CLI_INTEGRATION_GUIDE.md dist/ 2>/dev/null || echo "Guide not found" | |
# Create README for distribution | |
echo "# XFG STARK CLI Distribution" > dist/README.md | |
echo "" >> dist/README.md | |
echo "This package contains the XFG Burn → HEAT Mint STARK CLI tool." >> dist/README.md | |
echo "" >> dist/README.md | |
echo "## Contents:" >> dist/README.md | |
echo "- \`xfg-stark-cli\` - Main CLI binary" >> dist/README.md | |
echo "- \`auto_stark_proof.sh\` - Automated proof generation script" >> dist/README.md | |
echo "- \`stark_proof_generator.py\` - Python helper script" >> dist/README.md | |
echo "- \`progress_logger.py\` - Progress tracking script" >> dist/README.md | |
echo "- Integration guides and documentation" >> dist/README.md | |
echo "" >> dist/README.md | |
echo "## Usage:" >> dist/README.md | |
echo "\`\`\`bash" >> dist/README.md | |
echo "./xfg-stark-cli --help" >> dist/README.md | |
echo "./auto_stark_proof.sh" >> dist/README.md | |
echo "\`\`\`" >> dist/README.md | |
echo "" >> dist/README.md | |
echo "## Integration:" >> dist/README.md | |
echo "This CLI can be integrated with Fuego Wallet for automatic STARK proof generation." >> dist/README.md | |
# Make scripts executable | |
chmod +x dist/*.sh 2>/dev/null || true | |
chmod +x dist/*.py 2>/dev/null || true | |
# Create archive | |
tar -czf ${{ matrix.artifact_name }}.tar.gz -C dist . | |
zip -r ${{ matrix.artifact_name }}.zip dist/ | |
ls -la *.tar.gz *.zip | |
shell: bash | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact_name }} | |
path: | | |
${{ matrix.artifact_name }}.tar.gz | |
${{ matrix.artifact_name }}.zip | |
create-release: | |
needs: build-and-release | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: artifacts/**/* | |
generate_release_notes: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |