-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from sebastienrousseau/feature/mini-functions
fix(release): cleaning up the workflows and preparing v0.0.7
- Loading branch information
Showing
9 changed files
with
166 additions
and
213 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,140 @@ | ||
name: ❯ rust | ||
name: ❯ mini_functions_release | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
on: [push] | ||
|
||
jobs: | ||
rust: | ||
mini_functions_release: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
node-version: [16] | ||
target: | ||
- x86_64-unknown-linux-gnu # 64-bit Linux (kernel 2.6.32+, glibc 2.11+) | ||
- x86_64-pc-windows-gnu # 64-bit Windows (7 or later) | ||
- x86_64-apple-darwin # 64-bit macOS (10.7 Lion or later) | ||
- aarch64-unknown-linux-gnu # ARM64 Linux (kernel 4.1, glibc 2.17+) | ||
- aarch64-apple-darwin # ARM64 macOS (10.15 Catalina or later) | ||
include: | ||
- target: x86_64-unknown-linux-gnu # 64-bit Linux (kernel 2.6.32+, glibc 2.11+) | ||
os: ubuntu-latest | ||
- target: x86_64-pc-windows-gnu # 64-bit Windows (7 or later) | ||
os: ubuntu-latest | ||
- target: x86_64-apple-darwin # 64-bit macOS (10.7 Lion or later) | ||
os: macos-latest | ||
- target: aarch64-unknown-linux-gnu # ARM64 Linux (kernel 4.1, glibc 2.17+) | ||
os: ubuntu-latest | ||
- target: aarch64-apple-darwin # ARM64 macOS (10.15 Catalina or later) | ||
os: macos-latest | ||
|
||
max-parallel: 5 | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build 🚀 | ||
run: cargo build --verbose | ||
- name: Run tests 🧪 | ||
run: cargo test --verbose | ||
- name: Checkout repository 🛎️ | ||
id: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Restore dependencies cache 📦 | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo | ||
~/.rustup | ||
key: ${{ runner.os }}-cache-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo- | ||
${{ runner.os }}-rustup- | ||
- name: Install Rust 🦀 | ||
id: rust | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
- name: Install rustfmt 🦀 | ||
id: install-rustfmt | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
components: rustfmt | ||
override: true | ||
profile: minimal | ||
target: ${{ matrix.target }} | ||
toolchain: stable | ||
|
||
- name: Run rustfmt 🦀 | ||
id: rustfmt | ||
run: rustup component add rustfmt | ||
|
||
- name: Check formatting 🦀 | ||
id: fmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check --verbose --color=always | ||
|
||
- name: Set environment variables 🔢 | ||
run: | | ||
echo "VERSION=$(echo $(grep version Cargo.toml | sed -n 2p | cut -d '"' -f 2))" >> $GITHUB_ENV | ||
echo "ARTIFACT_NAME=mini-functions-${{ matrix.target }}" >> $GITHUB_ENV | ||
echo "COMMITS=$(git log -20 --oneline | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | awk '{labels="";for(i=2;i<=NF;i++){if($i~/^[a-zA-Z]+\([a-zA-Z0-9-_]+\):/)labels=labels" "$i;else break;}printf("-%s %s\n",labels,$0);}' | sort -k1,1)" >> $GITHUB_ENV | ||
- name: Build libraries 🏗 | ||
run: | | ||
# Check the code base | ||
cargo check --all | ||
# Install cross | ||
cargo install cross | ||
# Clean the build artifacts | ||
cargo clean | ||
# Build the libraries for the target platform and architecture | ||
cross build --release --target=${{ matrix.target }} --lib | ||
shell: /bin/bash -e {0} | ||
|
||
- name: Generate Changelog 📜 | ||
id: changelog | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
# Generate the release notes template | ||
echo "<img src='https://raw.githubusercontent.com/sebastienrousseau/vault/main/assets/shields/made-with-love.svg' alt='Made with Love' width='100%'/><br>" > ${{ github.workspace }}-CHANGELOG.md | ||
echo "<h1>Highly performant utility and wrapper functions library for Rust 🚀</h1><br>" > ${{ github.workspace }}-CHANGELOG.md | ||
echo "<img src='https://raw.githubusercontent.com/sebastienrousseau/vault/main/assets/banners/banner-mini-functions.svg' alt='Mini Functions Banner' width='100%'/><br>" > ${{ github.workspace }}-CHANGELOG.md | ||
echo "<h2>Welcome to Mini Functions 👋</h2><br>" >> ${{ github.workspace }}-CHANGELOG.md | ||
echo "Mini Functions is a highly performant utility and wrapper functions library for Rust that has been carefully designed with optimization and efficiency in mind.<br>" >> ${{ github.workspace }}-CHANGELOG.md | ||
echo "" >> ${{ github.workspace }}-CHANGELOG.md | ||
echo "By providing convenient wrapper functions, our library aims to provide a high-level interface for common tasks while still leveraging the performance benefits of Rust under the hood.<br>" >> ${{ github.workspace }}-CHANGELOG.md | ||
echo "" >> ${{ github.workspace }}-CHANGELOG.md | ||
echo "These utility functions serve as an essential toolkit for any Rust developer, and the library's design abstractions allow for easy integration into a variety of projects and applications." >> ${{ github.workspace }}-CHANGELOG.md | ||
echo "" >> ${{ github.workspace }}-CHANGELOG.md | ||
echo "<h2>Key Features 🎯</h2><br>" >> ${{ github.workspace }}-CHANGELOG.md | ||
echo "$COMMITS" >> ${{ github.workspace }}-CHANGELOG.md | ||
echo "..." >> ${{ github.workspace }}-CHANGELOG.md | ||
echo "" >> ${{ github.workspace }}-CHANGELOG.md | ||
- name: Upload artifacts 📦 | ||
id: upload | ||
if: github.ref == 'refs/heads/main' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.ARTIFACT_NAME }}_${{ env.VERSION }} | ||
path: target/release | ||
|
||
- name: Create Release 🚀 | ||
id: create_release | ||
if: github.ref == 'refs/heads/main' | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
body_path: ${{ github.workspace }}-CHANGELOG.md | ||
draft: true | ||
files: | | ||
target/release/* | ||
name: Mini Functions 🦀 v${{ env.VERSION }} | ||
prerelease: false | ||
tag_name: v${{ env.VERSION }} |
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.