Skip to content

Commit

Permalink
Update README and workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
kaleidawave committed Sep 12, 2023
1 parent 48deac2 commit 907720a
Show file tree
Hide file tree
Showing 10 changed files with 286 additions and 247 deletions.
56 changes: 32 additions & 24 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,22 @@ env:
target/
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: windows-latest
executable-extension: .exe
platform_name: x86_64-pc-windows
- os: ubuntu-latest
platform_name: x86_64-unknown-linux

runs-on: ${{ matrix.os }}
get-build-info:
runs-on: ubuntu-latest

outputs:
new-ezno-version: ${{ steps.get-version.outputs.new-ezno-version }}
sponsors: ${{ steps.get-sponsors.outputs.sponsors }}

steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATHS }}
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Get version
id: get-version
run: |
version=$(git tag --list 'release/main-*' --sort=-taggerdate | head -n 1)
echo "Releasing ${version:13}"
echo "new-ezno-version=${version:13}" >> $GITHUB_OUTPUT
- id: set-sponsors
- id: get-sponsors
run: |
SPONSORS=$(gh api graphql -f query='{
user(login: "kaleidawave") {
Expand All @@ -58,18 +43,41 @@ jobs:
}
}' -q '.data.user.sponsorshipsAsMaintainer.edges | map(.node.sponsor.login) | join(", ")')
export SPONSORS
echo "sponsors=$SPONSORS" >> $GITHUB_OUTPUT
shell: bash
env:
GH_TOKEN: ${{ github.token }}

build:
needs: [get-build-info]

strategy:
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: windows-latest
executable-extension: .exe
platform_name: x86_64-pc-windows
- os: ubuntu-latest
platform_name: x86_64-unknown-linux

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATHS }}
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build binary
run: cargo build --release

- name: Rename and move release assets
run: |
mkdir artifacts
mv target/release/ezno${{ matrix.executable-extension }} artifacts/ezno-${{ steps.get-version.outputs.new-ezno-version }}-${{ matrix.platform_name }}${{ matrix.executable-extension }}
export ${{ needs.get-build-info.outputs.sponsors }}
mv target/release/ezno${{ matrix.executable-extension }} artifacts/ezno-${{ needs.get-build-info.outputs.new-ezno-version }}-${{ matrix.platform_name }}${{ matrix.executable-extension }}
- uses: actions/upload-artifact@v3
with:
Expand All @@ -79,7 +87,7 @@ jobs:
retention-days: 1

github-release:
needs: [build]
needs: [build, get-build-info]
runs-on: ubuntu-latest

steps:
Expand All @@ -98,8 +106,8 @@ jobs:
- name: GitHub release
uses: softprops/action-gh-release@v1
with:
name: "Ezno ${{ needs.build.outputs.new-ezno-version }}"
tag_name: "release/ezno-${{ needs.build.outputs.new-ezno-version }}"
name: "Ezno ${{ needs.get-build-info.outputs.new-ezno-version }}"
tag_name: "release/ezno-${{ needs.get-build-info.outputs.new-ezno-version }}"
body: "For @kaleidawave to update"
files: |
README.md
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: (main) Crates release

# npm publish and GitHub release are triggered by this

on:
workflow_dispatch:
inputs:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ env:
jobs:
validity:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATHS }}
Expand All @@ -45,6 +49,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Check Rust formatting with rustfmt
run: cargo fmt --all --check
Expand All @@ -60,8 +67,12 @@ jobs:
tests:
needs: validity
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATHS }}
Expand Down Expand Up @@ -92,13 +103,17 @@ jobs:
fuzzing:
needs: validity
runs-on: ubuntu-latest
timeout-minutes: 30
continue-on-error: true
strategy:
matrix:
fuzz-target: [module_roundtrip_naive, module_roundtrip_structured]

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATHS }}
Expand Down Expand Up @@ -131,8 +146,12 @@ jobs:
clippy:
needs: validity
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATHS }}
Expand All @@ -143,8 +162,12 @@ jobs:
wasm-test:
needs: validity
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATHS }}
Expand Down Expand Up @@ -185,6 +208,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Check that it will publish to crates
run: |
cargo metadata --offline --format-version 1 --no-deps | jq -r ".workspace_members[]" | while read -r _n _v pathInfo ; do
Expand Down
Loading

0 comments on commit 907720a

Please sign in to comment.