mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 06:18:17 +00:00
Merge pull request #238 from maxcountryman/feature/gh-action-releases
automate crate publishing
This commit is contained in:
commit
118a345790
3 changed files with 53 additions and 0 deletions
13
.github/workflows/rust.yml
vendored
13
.github/workflows/rust.yml
vendored
|
@ -63,3 +63,16 @@ jobs:
|
||||||
uses: coverallsapp/github-action@master
|
uses: coverallsapp/github-action@master
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
publish-crate:
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [test]
|
||||||
|
steps:
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: hecrj/setup-rust-action@v1
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Publish
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cargo publish --token ${{ secrets.CRATES_TOKEN }}
|
||||||
|
|
|
@ -34,3 +34,6 @@ serde_json = { version = "1.0", optional = true }
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
simple_logger = "1.6"
|
simple_logger = "1.6"
|
||||||
matches = "0.1"
|
matches = "0.1"
|
||||||
|
|
||||||
|
[package.metadata.release]
|
||||||
|
disable-publish = true
|
||||||
|
|
37
docs/releasing.md
Normal file
37
docs/releasing.md
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
# Releasing
|
||||||
|
|
||||||
|
Releasing, i.e. crate publishing, has been automated via GitHub Actions.
|
||||||
|
|
||||||
|
We use the [`cargo release`](https://github.com/sunng87/cargo-release)
|
||||||
|
subcommand to ensure correct versioning. Install via:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ cargo install cargo-release
|
||||||
|
```
|
||||||
|
|
||||||
|
**Before releasing** ensure `CHANGELOG.md` is updated appropriately.
|
||||||
|
|
||||||
|
## Process
|
||||||
|
|
||||||
|
Using `cargo-release` we can author a new minor release like so:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ cargo release minor --skip-publish
|
||||||
|
```
|
||||||
|
|
||||||
|
**Ensure publishing is skipped** since pushing the resulting tag upstream will
|
||||||
|
handle crate publishing automatically.
|
||||||
|
|
||||||
|
This will create a new tag, `0.6.0` with the message,
|
||||||
|
`(cargo-release) sqlparser version 0.6.0`.
|
||||||
|
|
||||||
|
Once the tag is created, pushing the tag upstream will trigger a publishing
|
||||||
|
process to crates.io. Now to push our example tag:
|
||||||
|
|
||||||
|
```
|
||||||
|
git push origin 0.6.0
|
||||||
|
```
|
||||||
|
|
||||||
|
(Note that this process is fully automated; credentials
|
||||||
|
for authoring in this way are securely stored in the repo secrets as
|
||||||
|
`CRATE_TOKEN`.)
|
Loading…
Add table
Add a link
Reference in a new issue