add github action #1
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: Static Build | |
| on: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install musl dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libmusl-dev | |
| - name: Install Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| target: x86_64-unknown-linux-musl | |
| override: true | |
| - name: Build | |
| run: cargo build --verbose --release --locked --target x86_64-unknown-linux-musl | |
| - name: Create Release | |
| uses: actions/create-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }}-prerelease | |
| release_name: Latest Build | |
| prerelease: true | |
| - name: Upload Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: target/x86_64-unknown-linux-musl/release/${{ github.event.repository.name }} | |
| asset_name: ${{ github.event.repository.name }} | |
| asset_content_type: application/octet |