-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from ngyn-rs/dev
v0.4.3 - Response Interpretation and API Improvements
- Loading branch information
Showing
32 changed files
with
469 additions
and
230 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: PR Workflow | ||
on: | ||
pull_request: | ||
types: ready_for_review | ||
types: [ready_for_review] | ||
push: | ||
branches: | ||
- dev | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,39 @@ | ||
name: Gituhb release | ||
name: Release | ||
on: | ||
push: | ||
branches: main | ||
branches: [main] | ||
|
||
jobs: | ||
release: | ||
name: Perform release | ||
crates_io_publish: | ||
name: Publish (crates.io) | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
timeout-minutes: 25 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Cocogitto release | ||
id: release | ||
uses: oknozor/cocogitto-action@v3 | ||
- name: cargo-release Cache | ||
id: cargo_release_cache | ||
uses: actions/cache@v3 | ||
with: | ||
release: true | ||
check-latest-tag-only: true | ||
git-user: ${{ github.actor}} | ||
git-user-email: ${{ github.actor_id }}+${{ github.actor}}@users.noreply.github.com | ||
path: ~/.cargo/bin/cargo-release | ||
key: ${{ runner.os }}-cargo-release | ||
|
||
- name: Print version | ||
run: "echo '${{ steps.release.outputs.version }}'" | ||
- run: cargo install cargo-release | ||
if: steps.cargo_release_cache.outputs.cache-hit != 'true' | ||
|
||
- name: Generate Changelog | ||
run: cog changelog --at ${{ steps.release.outputs.version }} -t full_hash > GITHUB_CHANGELOG.md | ||
- name: cargo login | ||
run: cargo login ${{ secrets.CRATES_IO_API_TOKEN }} | ||
|
||
- name: Upload github release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body_path: GITHUB_CHANGELOG.md | ||
tag_name: ${{ steps.release.outputs.version }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
# allow-branch HEAD is because GitHub actions switches | ||
# to the tag while building, which is a detached head | ||
- name: "cargo release publish" | ||
run: |- | ||
cargo release \ | ||
publish \ | ||
--workspace \ | ||
--all-features \ | ||
--allow-branch HEAD \ | ||
--no-confirm \ | ||
--no-verify \ | ||
--execute |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Bump Version on PR (Rust Workspace) | ||
|
||
on: | ||
pull_request: | ||
types: [opened] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
bump_version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- name: Extract version from PR title | ||
id: extract_version | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const prTitle = context.payload.pull_request.title; | ||
const versionMatch = prTitle.match(/v(\d+\.\d+\.\d+)/); | ||
if (!versionMatch) { | ||
core.setFailed('No valid semver version found in PR title'); | ||
} else { | ||
// if pr title contains "minor" or "major" we bump accordingly | ||
if (prTitle.includes('minor')) { | ||
core.setOutput('version', 'minor'); | ||
} else if (prTitle.includes('major')) { | ||
core.setOutput('version', 'major'); | ||
} else { | ||
core.setOutput('version', `custom ${versionMatch[1]}`); | ||
} | ||
} | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Bump workspace version | ||
run: | | ||
cargo install cargo-workspaces | ||
cargo workspaces version ${{ steps.extract_version.outputs.version }} --all --allow-branch dev | ||
- name: Commit and push changes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
message: "Bump version to ${{ steps.extract_version.outputs.version }}" | ||
add: "*/Cargo.toml" | ||
push: true | ||
branch: dev | ||
default_author: github_actor | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
Oops, something went wrong.