Skip to content

Commit

Permalink
ci: Update deps & ci (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
AzHicham committed Dec 9, 2023
1 parent 1911455 commit 906f09a
Show file tree
Hide file tree
Showing 7 changed files with 267 additions and 108 deletions.
9 changes: 9 additions & 0 deletions .github/scripts/edit-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -euo pipefail

# This script is used to edit the version in versions files

echo "Editing files with given version: $1";

# Edit Cargo.toml
semantic-release-cargo prepare "$1"
16 changes: 0 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,8 @@ env:
RUST_VERSION: 1.72.1

jobs:
validate:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: MeilCli/regex-match@v1
name: SemVer Validation
id: regex-match
with:
search_string: ${{ github.event.release.tag_name }}
regex_pattern: '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
# SemVer Regex https://ihateregex.io/expr/semver/
- name: SemVer check failed
if: ${{ steps.regex-match.outputs.matched == 'false' }}
run: exit 1

publish:
runs-on: ubuntu-22.04
needs: [validate]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
workflow_dispatch: # only for release on develop branch
push:
branches:
- main
- rc
- experimental
- "[0-9]+.[0-9]+.x"
- "[0-9]+.x"

# Only allow one release workflow to execute at a time, since each release
# workflow uses shared resources (git tags, package registries)
concurrency:
group: ${{ github.workflow }}

jobs:
release:
runs-on: ubuntu-22.04
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false # Semantic release need use SCOPED_GITHUB_TOKEN to create release

- name: Install semantic-release-cargo
uses: EricCrosson/install-github-release-binary@v2
with:
targets: semantic-release-cargo/semantic-release-cargo@v2.2.30

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.SCOPED_GITHUB_TOKEN }}
with:
semantic_version: 22.0.6
extra_plugins: |
@semantic-release/changelog@6.0.3
@semantic-release/git@10.0.1
@semantic-release/exec@6.0.3
conventional-changelog-conventionalcommits@7.0.2
4 changes: 2 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ jobs:
toolchain: ${{ env.RUST_VERSION }}
override: true
components: rustfmt, clippy
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.12'
- name: Install pre-commit
run: pip install pre-commit
- name: Pre-commit
Expand Down
73 changes: 73 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"tagFormat": "${version}",
"branches": [
"main",
{
"name": "rc",
"prerelease": true
},
{
"name": "experimental",
"prerelease": "exp"
},
"+([0-9])?(.{+([0-9]),x}).x"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{ "type": "perf", "scope": "*", "release": "patch" },
{ "type": "refactor", "scope": "*", "release": "patch" },
{ "type": "chore", "scope": "*", "release": "patch" }
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{ "type": "feat", "section": "Features" },
{ "type": "fix", "section": "Bug Fixes" },
{ "type": "perf", "section": "Performance Improvements" },
{ "type": "revert", "section": "Reverts" },
{ "type": "docs", "section": "Documentation" },
{ "type": "ci", "section": "CI/CD", "hidden": false },
{ "type": "chore", "section": "Miscellaneous Chores", "hidden": false },
{ "type": "style", "section": "Styles", "hidden": true },
{ "type": "refactor", "section": "Code Refactoring", "hidden": true },
{ "type": "test", "section": "Tests", "hidden": true },
{ "type": "build", "section": "Build System", "hidden": true }
]
}
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "./.github/scripts/edit-version.sh ${nextRelease.version}"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"Cargo.toml",
"Cargo.lock"
],
"message": "chore(release): ${nextRelease.version}\n\n[skip ci]"
}
],
"@semantic-release/github"
]
}
Loading

1 comment on commit 906f09a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openslide-rs Benchmark

Benchmark suite Current: 906f09a Previous: 4ca361c Ratio
deepzoom_read_image_256 1171972 ns/iter (± 8073) 1173328 ns/iter (± 10223) 1.00
deepzoom_read_image_256_arc 1172322 ns/iter (± 14696) 1174733 ns/iter (± 10554) 1.00
deepzoom_read_image_256_recreate_dz 1173247 ns/iter (± 5419) 1176726 ns/iter (± 9604) 1.00
deepzoom_read_image_512 4704596 ns/iter (± 28620) 4708204 ns/iter (± 16139) 1.00
deepzoom_read_image_512_arc 4699182 ns/iter (± 49299) 4712144 ns/iter (± 35750) 1.00
deepzoom_read_image_512_recreate_dz 4705389 ns/iter (± 33276) 4712661 ns/iter (± 42107) 1.00
openslide_read_image_256 1136486 ns/iter (± 5606) 1137355 ns/iter (± 8106) 1.00
openslide_read_image_512 4720181 ns/iter (± 36402) 4719910 ns/iter (± 105189) 1.00
openslide_read_region_256 1085203 ns/iter (± 8360) 1087570 ns/iter (± 7325) 1.00
openslide_read_region_512 4513222 ns/iter (± 24242) 4520485 ns/iter (± 42504) 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.