Fix missing cleanup calls; minor code improvements #19
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: release | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
workflow_dispatch: | |
env: | |
CARGO_INCREMENTAL: 0 | |
permissions: | |
contents: write | |
jobs: | |
release: | |
name: ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get version | |
id: get_version | |
uses: SebRollen/[email protected] | |
with: | |
file: slickcmd/Cargo.toml | |
field: package.version | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
target: ${{ matrix.target }} | |
- name: Setup cache | |
uses: Swatinem/[email protected] | |
with: | |
key: ${{ matrix.target }} | |
- name: Build binary | |
uses: actions-rs/cargo@v1 | |
env: | |
CARGO_ENCODED_RUSTFLAGS: "-Ctarget-feature=+crt-static\u001F-Clink-args=/DEFAULTLIB:ucrt.lib /DEFAULTLIB:libvcruntime.lib libcmt.lib /NODEFAULTLIB:vcruntime.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libucrt.lib" | |
with: | |
command: build | |
args: --release --locked --target=${{ matrix.target }} --color=always --verbose | |
- name: Package (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
7z a slickcmd-${{ steps.get_version.outputs.value }}-${{ matrix.target }}.zip ` | |
CHANGELOG.md LICENSE README.md ` | |
./target/${{ matrix.target }}/release/slickcmd_shl.dll ` | |
./target/${{ matrix.target }}/release/slickcmd_core.dll ` | |
./target/${{ matrix.target }}/release/slickcmd.exe | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.target }} | |
path: | | |
*.zip | |
- name: Create release | |
if: | | |
github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'release:') | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
files: | | |
*.zip | |
name: ${{ steps.get_version.outputs.value }} | |
tag_name: "" |