diff --git a/.github/workflows/release-cli.yaml b/.github/workflows/release-cli.yaml index d2f4858..ece0310 100644 --- a/.github/workflows/release-cli.yaml +++ b/.github/workflows/release-cli.yaml @@ -1,29 +1,57 @@ +name: Release Cli + on: push: tags: - "*" - workflow_dispatch: jobs: - release: - name: release ${{ matrix.target }} - runs-on: ubuntu-latest + build: + name: Release binary strategy: - fail-fast: false matrix: include: - - target: x86_64-pc-windows-gnu - archive: zip - - target: x86_64-unknown-linux-musl - archive: tar.gz tar.xz tar.zst - - target: x86_64-apple-darwin - archive: zip + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + artifact_name: dar2oar + asset_name: dar2oar-x86_64-unknown-linux-gnu + - os: ubuntu-latest + target: x86_64-unknown-linux-musl + artifact_name: dar2oar + asset_name: dar2oar-x86_64-unknown-linux-musl + - os: ubuntu-latest + target: x86_64-pc-windows-gnu + artifact_name: dar2oar.exe + asset_name: dar2oar-x86_64-pc-windows-gnu.exe + - os: macos-latest + target: x86_64-apple-darwin + artifact_name: dar2oar + asset_name: dar2oar-x86_64-apple-darwin + + runs-on: ${{ matrix.os }} + steps: - - uses: actions/checkout@master - - name: Compile and release - uses: rust-build/rust-build.action@v1.4.3 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Cross build with all features + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: build + args: --release --target ${{ matrix.target }} --all-features --verbose + + - name: Upload binaries to release + uses: svenstaro/upload-release-action@2.1.1 with: - RUSTTARGET: ${{ matrix.target }} - ARCHIVE_TYPES: ${{ matrix.archive }} + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: target/${{ matrix.target }}/release/${{ matrix.artifact_name }} + asset_name: ${{ matrix.asset_name }} + tag: ${{ github.ref }} + overwrite: true