Prepare for release #57
Workflow file for this run
This file contains 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: deploy | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
windows-binaries: | |
strategy: | |
matrix: | |
conf: | |
- msvc | |
- gnu | |
include: | |
- conf: msvc | |
toolchain: stable | |
- conf: gnu | |
toolchain: stable-x86_64-pc-windows-gnu | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install stable | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- name: Build cargo-c | |
run: | | |
cargo build --profile release-strip | |
- name: Create zip | |
run: | | |
cd target/release-strip | |
7z a ../../cargo-c-windows-${{ matrix.conf }}.zip ` | |
"cargo-capi.exe" ` | |
"cargo-cbuild.exe" ` | |
"cargo-cinstall.exe" ` | |
"cargo-ctest.exe" | |
- name: Upload binaries | |
uses: actions/upload-artifact@v2 | |
with: | |
name: cargo-c-windows-${{ matrix.conf }}-binaries | |
path: cargo-c-windows-${{ matrix.conf }}.zip | |
linux-binaries: | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- i686-unknown-linux-musl | |
- x86_64-unknown-linux-musl | |
- powerpc64le-unknown-linux-gnu | |
- aarch64-unknown-linux-musl | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Install cross | |
run: | | |
cargo install cross --git https://github.com/cross-rs/cross | |
- name: Build cargo-c | |
run: | | |
cross build --target ${{ matrix.target }} \ | |
--features=vendored-openssl \ | |
--profile release-strip | |
- name: Create zip | |
run: | | |
cd target/${{ matrix.target }}/release-strip | |
tar -czvf $GITHUB_WORKSPACE/cargo-c-${{ matrix.target }}.tar.gz \ | |
cargo-capi \ | |
cargo-cbuild \ | |
cargo-cinstall \ | |
cargo-ctest | |
- name: Upload binaries | |
uses: actions/upload-artifact@v2 | |
with: | |
name: cargo-c-linux-binaries | |
path: cargo-c-${{ matrix.target }}.tar.gz | |
macos-binaries: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install stable | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Build cargo-c | |
run: | | |
cargo build --features=vendored-openssl --profile release-strip | |
- name: Create zip | |
run: | | |
cd target/release-strip | |
zip $GITHUB_WORKSPACE/cargo-c-macos.zip \ | |
cargo-capi \ | |
cargo-cbuild \ | |
cargo-cinstall \ | |
cargo-ctest | |
- name: Upload binaries | |
uses: actions/upload-artifact@v2 | |
with: | |
name: cargo-c-macos-binaries | |
path: cargo-c-macos.zip | |
deploy: | |
needs: [windows-binaries, linux-binaries, macos-binaries] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install stable | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Download zip files | |
uses: actions/download-artifact@v2 | |
- name: Create Cargo.lock | |
run: | | |
cargo update | |
- name: Create a release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
Cargo.lock | |
cargo-c-linux-binaries/*.tar.gz | |
cargo-c-macos-binaries/cargo-c-macos.zip | |
cargo-c-windows-msvc-binaries/cargo-c-windows-msvc.zip | |
cargo-c-windows-gnu-binaries/cargo-c-windows-gnu.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |