Skip to content

Commit 50f5b08

Browse files
ci: Automate crate releases (#210)
1 parent 003102e commit 50f5b08

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@ on:
55
types: [created]
66

77
jobs:
8-
release-image:
8+
release-crate:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: ./.github/actions/asdf
13+
with:
14+
rust: true
15+
- run: cargo publish --token '${{ secrets.CRATES_TOKEN }}'
16+
working-directory: bindings/rust
17+
18+
build-go-binaries:
919
runs-on: ubuntu-latest
1020

1121
strategy:

Development.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ PACKAGE=MY_PACKAGE_NAME SRC_ACCESS_TOKEN=MY_TOKEN SRC_ENDPOINT=https://sourcegra
8888
## Release a new version
8989

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

9394
After landing a commit with those two changes, run the release script:
9495
(requires the [GitHub CLI](https://cli.github.com/))

bindings/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "scip"
3-
version = "0.1.1"
3+
version = "0.3.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
description = """

dev/publish-release.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ if ! grep -q "$NEW_VERSION" cmd/scip/version.txt; then
2020
exit 1
2121
fi
2222

23+
if ! grep -q "version = \"$NEW_VERSION\"" bindings/rust/Cargo.toml; then
24+
echo "error: SCIP version in bindings/rust/Cargo.toml doesn't match NEW_VERSION=$NEW_VERSION"
25+
exit 1
26+
fi
27+
2328
if ! git diff --quiet; then
2429
echo "error: Found unstaged changes; aborting."
2530
exit 1

0 commit comments

Comments
 (0)