Skip to content

Commit

Permalink
chore(ci): Add release infrastructure (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated authored Apr 5, 2023
1 parent 767f281 commit 279be62
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 2 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish crate

on:
workflow_dispatch:
inputs:
ref:
description: The reference to checkout
required: true

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- name: Setup toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.66.0

- name: Publish barretenberg-sys
run: |
cargo publish --package barretenberg-sys
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.BARRETENBERG_SYS_CRATES_IO_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pull Request

on:
merge_group:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
conventional-title:
name: Validate PR title is Conventional Commit
runs-on: ubuntu-latest
steps:
- name: Check title
if: github.event_name == 'pull_request_target'
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
fix
feat
chore
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
branches:
- master

jobs:
release-please:
name: Create Release
outputs:
release-pr: ${{ steps.release.outputs.pr }}
tag-name: ${{ steps.release.outputs.tag_name }}
runs-on: ubuntu-latest
steps:
- name: Run release-please
id: release
uses: google-github-actions/release-please-action@v3
with:
release-type: rust
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
pull-request-title-pattern: "chore: Release ${version}"

publish:
name: Publish crates
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-latest
steps:
- name: Dispatch to publish workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish.yml
ref: master
inputs: '{ "ref": "${{ needs.release-please.outputs.tag-name }}" }'
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "barretenberg-sys"
version = "0.1.0"
version = "0.0.0"
description = "FFI bindings to Barretenberg"
authors = ["The Noir Team <[email protected]>"]
repository = "https://github.com/noir-lang/barretenberg-sys/"
Expand Down

0 comments on commit 279be62

Please sign in to comment.