Skip to content

Commit

Permalink
Prepare for v0.1.1 (#4)
Browse files Browse the repository at this point in the history
Add RELEASE.md to document the release workflow. Follows the guide in
prep for v0.1.1.

To publish this release will create the tags `v0` and `v0.1` in addition
to the current release `v0.1.1`.
  • Loading branch information
emcfarlane committed May 31, 2024
1 parent fc0b591 commit 791b5c7
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 24 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
username: ${{ secrets.BUF_USERNAME }}
token: ${{ secrets.BUF_TOKEN }}
Expand Down Expand Up @@ -81,7 +81,7 @@ This will install `buf` and optionally login to the schema registry but no addit
Subsequent steps will have `buf` available in their $PATH and can invoke `buf` directly.

```yaml
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
setup_only: true
- run: buf build --error-format github-actions
Expand All @@ -93,7 +93,7 @@ To skip or disable parts of the workflow, each step corresponds to a boolean fla
For example to disable linting set the input `lint` to `false`:

```yaml
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
lint: false
```
Expand All @@ -106,7 +106,7 @@ To trigger steps on different events use the GitHub action context to deduce the
For example to enable formatting checks on both pull requests and push create an expression for the input `format`:

```yaml
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
format: ${{ contains(fromJSON('["push", "pull_request"]'), github.event_name) }}
```
Expand All @@ -119,7 +119,7 @@ To conditionally run checks based on user input, use the GitHub action context t
For example to disable breaking change detection on commits, create an expression on the input `breaking` to check the contents of the commit message:

```yaml
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
breaking: |
contains(fromJSON('["push", "pull_request"]'), github.event_name) &&
Expand All @@ -133,7 +133,7 @@ See [GitHub Actions job context](https://docs.github.com/en/actions/reference/co
To ensure the version of `buf` is consistent across workflows it's recommended to always use an explicit version.

```yaml
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
version: 1.32.2
```
Expand All @@ -154,7 +154,7 @@ The `username` and `token` values can be stored as secrets in the repository set
The `token` value can be [generated from the Buf Schema Registry UI](https://buf.build/docs/bsr/authentication#create-an-api-token).

```yaml
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
username: ${{ secrets.BUF_USERNAME }}
token: ${{ secrets.BUF_TOKEN }}
Expand Down Expand Up @@ -192,7 +192,7 @@ runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
comment: false
```
Expand All @@ -204,7 +204,7 @@ To run the action for inputs not specified at the root of the repository, set th
Breaking change detection will also be required to be set to include a `subdir` configured to the same input path.

```yaml
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
input: protos
breaking_against: |
Expand All @@ -221,7 +221,7 @@ Alternatively, you may wish to pre-checkout the base branch for breaking changes
with:
path: base
ref: ${{ github.event.pull_request.base.sha }}
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
input: head/protos
breaking_against: base/protos
Expand Down Expand Up @@ -294,7 +294,7 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
version: 1.32.2
username: ${{ secrets.BUF_USERNAME }}
Expand Down
37 changes: 37 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Releasing buf-action

This document outlines how to create a release of buf-action.
We follow the best practices outlined in the [GitHub Actions documentation][github-release-docs] and [GitHub Actions Toolkit tutorial][github-release-tutorial].

1. Clone the repo, ensuring you have the latest main.

2. On a new branch, run the following commands to update the version of the action:

```bash
VERSION=X.Y.Z make update-version
```

3. Open a PR titled "Prepare for vX.Y.Z". Once it's reviewed and CI passes, merge it.

*Make sure no new commits are merged until the release is complete.*

4. Create a new release using the Github UI:
- Under “Choose a tag”, type in “vX.Y.Z” to create a new tag for the release upon publish.
- Target the main branch.
- Title the Release “vX.Y.Z”.
- Click “set as latest release”.
- Click "Publish this Action to the GitHub Marketplace".


5. Publish the release.

6. Pull down the latest main and move the tags for major (vX) and minor (vX.Y) releases.

```bash
git tag -fa vX -m "Update vX tag"
git tag -fa vX.Y -m "Update vX.Y tag"
git push origin vX vX.Y --force
```

[github-release-docs]: https://docs.github.com/en/actions/creating-actions/releasing-and-maintaining-actions
[github-release-tutorial]: https://github.com/actions/toolkit/blob/master/docs/action-versioning.md
2 changes: 1 addition & 1 deletion examples/buf-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
username: ${{ secrets.BUF_USERNAME }}
token: ${{ secrets.BUF_TOKEN }}
2 changes: 1 addition & 1 deletion examples/only-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
2 changes: 1 addition & 1 deletion examples/only-setup-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
setup_only: true
- env:
Expand Down
2 changes: 1 addition & 1 deletion examples/only-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
# Add username or token secrets to your repository settings to
# authenticate with the Buf Schema Registry.
Expand Down
2 changes: 1 addition & 1 deletion examples/only-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
username: ${{ secrets.BUF_USERNAME }}
token: ${{ secrets.BUF_TOKEN }}
2 changes: 1 addition & 1 deletion examples/push-on-changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
username: ${{ secrets.BUF_USERNAME }}
token: ${{ secrets.BUF_TOKEN }}
2 changes: 1 addition & 1 deletion examples/skip-on-commits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
username: ${{ secrets.BUF_USERNAME }}
token: ${{ secrets.BUF_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion examples/skip-on-labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
username: ${{ secrets.BUF_USERNAME }}
token: ${{ secrets.BUF_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion examples/validate-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
# Username and token are required to authenticate with the Buf Schema Registry.
username: ${{ secrets.BUF_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion examples/version-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
setup_only: true
- run: buf version
2 changes: 1 addition & 1 deletion examples/version-file.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- run: |
echo "1.32.0" > .bufversion
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
setup_only: true
- run: buf version
2 changes: 1 addition & 1 deletion examples/version-input.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
setup_only: true
version: 1.32.2
Expand Down
2 changes: 1 addition & 1 deletion examples/version-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
with:
setup_only: true
- run: buf version

0 comments on commit 791b5c7

Please sign in to comment.