mergegate/.github/workflows/release.yml
Shunsuke Hayashi b4e6001c72 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>
2025-11-22 23:37:26 +09:00

74 lines
2 KiB
YAML

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