-
Notifications
You must be signed in to change notification settings - Fork 0
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 #4 from busticated/feature/publishing
feature/publishing
- Loading branch information
Showing
17 changed files
with
728 additions
and
38 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
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,30 @@ | ||
name: Publish | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
tags: | ||
type: string | ||
required: true | ||
secrets: | ||
CARGO_REGISTRY_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Source Code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-tags: true | ||
- name: Install Rust Toolchain (stable) | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Setup Project | ||
run: cargo xtask setup | ||
- name: Publish to Crates.io | ||
if: contains(inputs.tags, '@') | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
run: cargo xtask crate:publish | ||
|
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 |
---|---|---|
|
@@ -111,6 +111,22 @@ Run `cargo xtask help` to see any other docs-related commands that are available | |
</p> | ||
</details> | ||
|
||
<details id="develop-publish-crate"> | ||
<summary><b>How to publish crates</b></summary> | ||
<p> | ||
|
||
To publish a crate to the [crates.io](https://crates.io) registry, follow these steps: | ||
|
||
1. Checkout the `main` branch: `git checkout main` | ||
2. Run `cargo xtask crate:release` and follow the prompts | ||
3. Verify all checks pass: `cargo xtask ci` | ||
4. Push to remote: `git push origin main --follow-tags` | ||
|
||
Each crate you select for publishing will be assigned its new version and all changes will be committed and tagged in `git`. The assigned tag will be formatted like `name@version` (e.g. `[email protected]`). After pushing to the remote, CI will execute the publishing steps and if all goes well, your crate will be available on [crates.io](https://crates.io). | ||
|
||
</p> | ||
</details> | ||
|
||
<details id="develop-todo"> | ||
<summary><b>How to view and add TODO source code comments</b></summary> | ||
<p> | ||
|
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,24 @@ | ||
#!/bin/bash | ||
|
||
echo | ||
echo ":::: GIT Commit:" | ||
git log -1 | ||
|
||
echo | ||
echo ":::: GIT Tags:" | ||
git tag --points-at HEAD | ||
|
||
taglistStr=$(git tag --points-at HEAD) | ||
declare -a taglist=($taglistStr) | ||
tags="" | ||
|
||
for tag in "${taglist[@]}"; do | ||
tags="${tags} ${tag}" | ||
done | ||
|
||
echo | ||
echo ":::: Set Action Output: Tags:" | ||
echo "tags=$tags" >> $GITHUB_OUTPUT | ||
echo $tags | ||
echo | ||
|
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.