fixing naming issue #11
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: CI | |
on: | |
push: | |
# Automatically cancel any previous runs of this workflow | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: "clippy, rustfmt" | |
- uses: Swatinem/rust-cache@v2 | |
- name: Checking formatting | |
run: cargo fmt -- --check --color always | |
- name: Running clippy | |
run: cargo clippy --all-targets --all-features -- -D warnings | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, macos-12, windows-2022] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Test | |
run: cargo test --all-targets --all-features && cargo test --doc | |
release: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
target: x86_64-unknown-linux-gnu | |
- os: macos-12 | |
target: x86_64-apple-darwin | |
- os: macos-13-arm64 | |
target: aarch64-apple-darwin | |
- os: windows-2022 | |
target: x86_64-pc-windows-msvc | |
runs-on: ${{ matrix.os }} | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build --release --locked --target ${{ matrix.target }} | |
- name: Package | |
run: | | |
name=cargo-export | |
tag=$(git describe --tags --abbrev=0) | |
release_name="$name-$tag-${{ matrix.target }}" | |
release_tar="${release_name}.tar.gz" | |
mkdir "$release_name" | |
if [ "${{ matrix.os }}" != "windows-2022" ]; then | |
strip "target/${{ matrix.target }}/release/$name" | |
fi | |
cp "target/${{ matrix.target }}/release/${{ matrix.bin }}" "$release_name/" | |
cp README.md LICENSE "$release_name/" | |
tar czvf "$release_tar" "$release_name" | |
rm -r "$release_name" | |
if [ "${{ matrix.os }}" != "windows-2022" ]; then | |
echo "(Get-FileHash \"${release_tar}\" -Algorithm SHA256).Hash | Out-File -Encoding ASCII -NoNewline \"${release_tar}.sha256\"" | pwsh -c - | |
else | |
echo -n "$(shasum -ba 256 "${release_tar}" | cut -d " " -f 1)" > "${release_tar}.sha256" | |
fi | |
- name: Publish | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: "cargo-export-*.tar.gz*" | |
env: | |
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} |