Skip to content

Commit

Permalink
ci: Automate crate releases (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
varungandhi-src authored Oct 25, 2023
1 parent 003102e commit 50f5b08
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ on:
types: [created]

jobs:
release-image:
release-crate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/asdf
with:
rust: true
- run: cargo publish --token '${{ secrets.CRATES_TOKEN }}'
working-directory: bindings/rust

build-go-binaries:
runs-on: ubuntu-latest

strategy:
Expand Down
3 changes: 2 additions & 1 deletion Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ PACKAGE=MY_PACKAGE_NAME SRC_ACCESS_TOKEN=MY_TOKEN SRC_ENDPOINT=https://sourcegra
## Release a new version

First, add release notes to the [CHANGELOG](CHANGELOG.md).
Next, update the version in `cmd/scip/version.txt`.
Next, update the version in `cmd/scip/version.txt`
and `bindings/rust/Cargo.toml`.

After landing a commit with those two changes, run the release script:
(requires the [GitHub CLI](https://cli.github.com/))
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "scip"
version = "0.1.1"
version = "0.3.0"
edition = "2021"
license = "Apache-2.0"
description = """
Expand Down
5 changes: 5 additions & 0 deletions dev/publish-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ if ! grep -q "$NEW_VERSION" cmd/scip/version.txt; then
exit 1
fi

if ! grep -q "version = \"$NEW_VERSION\"" bindings/rust/Cargo.toml; then
echo "error: SCIP version in bindings/rust/Cargo.toml doesn't match NEW_VERSION=$NEW_VERSION"
exit 1
fi

if ! git diff --quiet; then
echo "error: Found unstaged changes; aborting."
exit 1
Expand Down

0 comments on commit 50f5b08

Please sign in to comment.