see changelog 0.7.0 #27
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: | |
pull_request: | |
workflow_dispatch: | |
push: | |
tags: | |
- 'v*' # This will trigger on any tag starting with 'v' | |
env: | |
RUSTFLAGS: -D warnings --cfg=web_sys_unstable_apis | |
RUSTDOCFLAGS: -D warnings | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --all-features | |
test: | |
name: Test Suite | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- run: sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --lib | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: clippy | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: -- -D warnings | |
build: | |
name: Build | |
needs: [ check, test, fmt, clippy ] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
extension: "" | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
extension: "" | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
extension: "" | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
extension: .exe | |
steps: | |
- name: Building ${{ matrix.target }} | |
run: echo "${{ matrix.target }}" | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
override: true | |
- name: Install Linux dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y cmake libssl-dev pkg-config libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev | |
- name: Install macOS dependencies | |
if: runner.os == 'macOS' | |
run: brew install cmake | |
- name: Install Windows dependencies | |
if: runner.os == 'Windows' | |
run: | | |
vcpkg install openssl:x64-windows-static | |
echo "OPENSSL_DIR=C:/vcpkg/installed/x64-windows-static" >> $GITHUB_ENV | |
echo "OPENSSL_STATIC=1" >> $GITHUB_ENV | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --verbose --release --target=${{ matrix.target }} | |
- name: Prepare artifacts | |
shell: bash | |
run: | | |
| | |
mkdir -p artifacts | |
cp target/${{ matrix.target }}/release/indyforge${{ matrix.extension }} artifacts/indyforge-${{ matrix.target }}${{ matrix.extension }} | |
cd artifacts | |
if [[ "$RUNNER_OS" == "Windows" ]]; then | |
certutil -hashfile indyforge-${{ matrix.target }}${{ matrix.extension }} SHA256 > indyforge-${{ matrix.target }}.sha256 | |
elif [[ "$RUNNER_OS" == "macOS" ]]; then | |
shasum -a 256 indyforge-${{ matrix.target }}${{ matrix.extension }} > indyforge-${{ matrix.target }}.sha256 | |
else | |
sha256sum indyforge-${{ matrix.target }}${{ matrix.extension }} > indyforge-${{ matrix.target }}.sha256 | |
fi | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: indyforge-${{ matrix.target }} | |
path: | | |
artifacts/indyforge-${{ matrix.target }}${{ matrix.extension }} | |
artifacts/indyforge-${{ matrix.target }}.sha256 | |
if-no-files-found: error | |
create-release: | |
name: Create Release | |
needs: build | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download all artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: Prepare release assets | |
run: | | |
mkdir release-assets | |
find artifacts -type f -exec cp {} release-assets/ \; | |
cd release-assets | |
sha256sum * > SHA256SUMS | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
release-assets/* | |
generate_release_notes: true | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
notify: | |
name: Notify | |
needs: create-release | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Send notification | |
run: | | |
echo "Release ${{ github.ref_name }} has been published successfully!" | |
echo "Visit https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}" |