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: Publish release files for CD native environments | |
on: | |
# workflow_run: | |
# workflows: ["Check SemVer compliance"] | |
# types: | |
# - completed | |
release: | |
types: [ created ] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ ubuntu-latest, macos-latest, macos-13, windows-latest ] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- name: Check format | |
run: cargo fmt --all -- --check | |
- name: Run clippy | |
run: cargo clippy --all-targets --locked -- -D warnings | |
- name: Run clippy (All features) | |
run: cargo clippy --all-targets --locked --all-features -- -D warnings | |
- name: Run tests | |
run: cargo test | |
- name: Build in Release profile with all features enabled | |
run: cargo build --release --all-features | |
- name: Rename Release (Unix) | |
run: | | |
cargo install default-target | |
mkdir assets | |
FILENAME=topgrade-${{github.event.release.tag_name}}-$(default-target) | |
mv target/release/topgrade assets | |
cd assets | |
tar --format=ustar -czf $FILENAME.tar.gz topgrade | |
rm topgrade | |
ls . | |
if: ${{ matrix.platform != 'windows-latest' }} | |
shell: bash | |
- name: Rename Release (Windows) | |
run: | | |
cargo install default-target | |
mkdir assets | |
FILENAME=topgrade-${{github.event.release.tag_name}}-$(default-target) | |
mv target/release/topgrade.exe assets/topgrade.exe | |
cd assets | |
powershell Compress-Archive -Path * -Destination ${FILENAME}.zip | |
rm topgrade.exe | |
ls . | |
if: ${{ matrix.platform == 'windows-latest' }} | |
shell: bash | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: assets/* |