Skip to content

Commit

Permalink
refactor: Redesign API for serde support
Browse files Browse the repository at this point in the history
BREAKING CHANGE: API redesigned for serde & Stream support & msrv bumped to 1.75. See [MIGRATING/v0.6.0.md](https://github.com/Alorel/rust-indexed-db/blob/v0.6.0/MIGRATING/v0.6.0.md) for details.
  • Loading branch information
Alorel committed Oct 21, 2024
1 parent a501fca commit dc06bbe
Show file tree
Hide file tree
Showing 179 changed files with 12,822 additions and 3,779 deletions.
56 changes: 56 additions & 0 deletions .github/actions/changelog/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Generate changelog
description: Generate the changelog
outputs:
release-type:
description: Release type
value: ${{ steps.log.outputs.release-type }}
version:
description: Next version
value: ${{ steps.log.outputs.next-version }}
issues-closed:
description: Issues closed
value: ${{ steps.log.outputs.issues-closed }}
changelog:
description: Changelog value
value: ${{ steps.log.outputs.changelog }}
should-release:
description: Should release
value: ${{ steps.log.outputs.should-release }}
runs:
using: composite
steps:
- name: Conditional args
id: args
if: ${{ startsWith(github.ref, 'refs/tags/') }}
shell: bash
run: >
echo "before=${{ github.ref_name }}" >> $GITHUB_OUTPUT &&
echo "until=${{ github.ref_name }}" >> $GITHUB_OUTPUT
- name: Get last tag
id: last-tag
uses: alorel-actions/semantic-release-lite/last-tag@v0
with:
before: ${{ steps.args.outputs.before }}

- name: Generate changelog
id: log
uses: alorel-actions/semantic-release-lite/generate-changelog@v0
with:
last-tag: ${{ steps.last-tag.outputs.last-tag }}
from: ${{ steps.last-tag.outputs.last-tag }}
until: ${{ steps.args.outputs.until || github.sha }}
stay-at-zero: true
minor-types: |
feat: Features
rm: Removals
patch-types: |
fix: Bug Fixes
perf: Performance
chore: Maintenance
deps: Dependency updates
refactor: Refactors
docs: Documentation
trivial-types: |
ci: CI & Build
build: CI & Build
30 changes: 0 additions & 30 deletions .github/actions/prep-release/action.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/actions/release/action.yml

This file was deleted.

71 changes: 0 additions & 71 deletions .github/workflows/_test.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/inc/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Unit test
on:
workflow_call:
inputs:
toolchain:
description: Rust version
default: stable
type: string
os:
description: OS to run on
default: ubuntu-latest
type: string
flags:
description: cli args
type: string

permissions:
contents: read

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: --deny warnings

jobs:
test:
name: Test with ${{ inputs.flags || 'no flags' }} on ${{ inputs.os }}, ${{ inputs.toolchain }}
runs-on: ${{ inputs.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Init toolchain
uses: alorel-actions/cargo/init@v1
with:
toolchain: ${{ inputs.toolchain }}
cache-prefix: test
cache-suffix: ${{inputs.flags}}
local: true

- name: Build
run: cargo build --locked ${{ inputs.flags }}

- name: Install wasm-pack
uses: alorel-actions/cargo-global-dep@v1
with:
name: wasm-pack
version: 0.13.0

- name: Test (Chrome)
if: ${{ runner.os != 'macOS' }}
run: wasm-pack test --chrome --headless --locked ${{ inputs.flags }}

- name: Test (Firefox)
if: ${{ runner.os != 'macOS' }}
run: wasm-pack test --firefox --headless --locked ${{ inputs.flags }}

- name: Test (Safari)
if: ${{ runner.os == 'macOS' }}
run: wasm-pack test --safari --headless --locked ${{ inputs.flags }}
120 changes: 85 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Release
concurrency: release
on:
workflow_dispatch: {}
workflow_dispatch: { }

permissions:
contents: read
Expand All @@ -13,14 +13,38 @@ env:
jobs:
test:
name: Test
uses: ./.github/workflows/_test.yml
uses: ./.github/workflows/test.yml
with:
is-workflow-call: true

release:
name: Release
prepare:
name: Set up
runs-on: ubuntu-latest
outputs:
release-type: ${{ steps.changelog.outputs.release-type }}
version: ${{ steps.changelog.outputs.version }}
issues-closed: ${{ steps.changelog.outputs.issues-closed }}
changelog: ${{ steps.changelog.outputs.changelog }}
should-release: ${{ steps.changelog.outputs.should-release }}
steps:
- uses: actions/checkout@v4
name: Checkout
with:
fetch-depth: 0
fetch-tags: true

- name: Generate changelog
id: changelog
uses: ./.github/actions/changelog

git:
name: Git release
runs-on: ubuntu-latest
needs:
- test
runs-on: ubuntu-latest
environment: crates-io
- prepare
if: ${{ needs.prepare.outputs.should-release }}
environment: github
permissions:
contents: write
steps:
Expand All @@ -31,37 +55,63 @@ jobs:
fetch-tags: true
token: ${{ secrets.GH_TOKEN }}

- name: Parse
id: parse
uses: alorel-actions/semantic-release-lite@v0
- name: Git identity
uses: alorel-actions/git-ident@v1

- name: Init toolchain
uses: alorel-actions/cargo/init@v1
with:
cache-prefix: release

- name: cargo-bump
uses: alorel-actions/cargo/bump@v1
with:
release-type: ${{ needs.prepare.outputs.release-type }}

- name: Git release
uses: alorel-actions/cargo/release-git@v1
with:
stay-at-zero: true
minor-types: |
feat: Features
patch-types: |
fix: Bug Fixes
trivial-types: |
chore: Maintenance
deps: Dependency updates
ci: CI & Build
build: CI & Build
refactor: Refactors
docs: Documentation
perf: Performance
version: ${{ needs.prepare.outputs.version }}
changelog: ${{ needs.prepare.outputs.changelog }}

- name: Prep release
if: ${{ steps.parse.outputs.should-release }}
id: prep
uses: ./.github/actions/prep-release
release:
name: Crate release
needs:
- git
if: ${{ needs.prepare.outputs.should-release }}
runs-on: ubuntu-latest
environment: crates-io
steps:
- uses: actions/checkout@v4
name: Checkout
with:
release-type: ${{ steps.parse.outputs.release-type }}
version: ${{ steps.parse.outputs.next-version }}
fetch-tags: true
ref: ${{ needs.prepare.outputs.version }}

- name: Release
if: ${{ steps.prep.outputs.in-sync }}
uses: ./.github/actions/release
- name: Init toolchain
uses: alorel-actions/cargo/init@v1
with:
cache-prefix: release

- name: Publish crate
run: cargo publish --locked --token ${{ secrets.CRATES_IO_TOKEN }}

notify:
name: Notify closed issues
needs:
- release
- prepare
if: ${{ needs.prepare.outputs.should-release && needs.prepare.outputs.issues-closed }}
runs-on: ubuntu-latest
environment: github
permissions:
contents: write
steps:
- name: Notify
if: ${{ needs.prepare.outputs.issues-closed }}
uses: alorel-actions/semantic-release-lite/notify@v0
with:
version: ${{ steps.parse.outputs.next-version }}
changelog: ${{ steps.parse.outputs.changelog }}
issues-closed: ${{ steps.parse.outputs.issues-closed }}
crates-io-token: ${{ secrets.CRATES_IO_TOKEN }}
tag: ${{ needs.prepare.outputs.version }}
issues: ${{ needs.prepare.outputs.issues-closed }}
allow-out-of-sync: true
gh-token: ${{ secrets.GH_TOKEN }}
Loading

0 comments on commit dc06bbe

Please sign in to comment.