Skip to content

Commit

Permalink
Merge pull request #21 from sebastienrousseau/feature/mini-functions
Browse files Browse the repository at this point in the history
fix(release): cleaning up the workflows and preparing v0.0.7
  • Loading branch information
sebastienrousseau authored Jan 7, 2023
2 parents 7a44c79 + 0cdd14e commit 033b0fc
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 213 deletions.
100 changes: 0 additions & 100 deletions .github/workflows/release.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/rust-clippy.yml

This file was deleted.

144 changes: 132 additions & 12 deletions .github/workflows/rust.yml
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 }}
31 changes: 0 additions & 31 deletions .github/workflows/rustfmt.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: weekly
name: monday

env:
CARGO_TERM_COLOR: always

on:
schedule:
- cron: 00 3 * * 1
- cron: 0 0 * * 1
jobs:
build:
strategy:
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"binutils",
"blake",
"certutil",
"commitish",
"congruential",
"czvf",
"datetime",
Expand All @@ -18,9 +19,11 @@
"hasher",
"hashfile",
"libexec",
"libmini",
"linux",
"msvc",
"nanos",
"oneline",
"qrcode",
"rlib",
"rustc",
Expand Down
Loading

0 comments on commit 033b0fc

Please sign in to comment.