ci: Add GitHub Actions workflows
- CI workflow for build, test, fmt, clippy - Multi-platform builds (Linux, macOS x86_64, macOS ARM) - Release workflow with artifact uploads - Security audit integration Note: Push with token that has 'workflow' scope 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
48dfa915c7
commit
b4e6001c72
2 changed files with 174 additions and 0 deletions
74
.github/workflows/release.yml
vendored
Normal file
74
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
create-release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
build-and-upload:
|
||||
name: Build and Upload
|
||||
needs: create-release
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
artifact: miyabi-linux-x86_64
|
||||
binary: miyabi
|
||||
- os: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
artifact: miyabi-macos-x86_64
|
||||
binary: miyabi
|
||||
- os: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
artifact: miyabi-macos-aarch64
|
||||
binary: miyabi
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Build release binary
|
||||
run: cargo build --release --target ${{ matrix.target }}
|
||||
|
||||
- name: Package binary (Unix)
|
||||
if: matrix.os != 'windows-latest'
|
||||
run: |
|
||||
cd target/${{ matrix.target }}/release
|
||||
tar czvf ../../../${{ matrix.artifact }}.tar.gz ${{ matrix.binary }}
|
||||
cd -
|
||||
|
||||
- name: Upload Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
||||
asset_path: ./${{ matrix.artifact }}.tar.gz
|
||||
asset_name: ${{ matrix.artifact }}.tar.gz
|
||||
asset_content_type: application/gzip
|
||||
Loading…
Add table
Add a link
Reference in a new issue