Skip to content

Commit

Permalink
Add automated release process
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Frantz <[email protected]>
  • Loading branch information
cfrantz committed Feb 2, 2023
1 parent 00d4c87 commit a4b413c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Create Release
on:
workflow_dispatch:
inputs:
release_tag:
required: true
type: string

jobs:
release:
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install Dependencies
run: |
echo "No dependencies to install"
# sudo apt-get update
# sudo apt-get install -y $(find . -name apt-requirements.txt | xargs cat)
- name: Build
run: |
bazel build :release
- name: Test
run: |
echo "No tests to run"
# bazel test //...
- name: Publish Release
env:
GH_TOKEN: ${{ github.token }}
run: |
bazel run :release -- ${{ inputs.release_tag }}
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This repository contains bazel automation for performing releases to GitHub.

## Usage

### Configuration

Load this repository in your `WORKSPACE`:

```
Expand All @@ -22,7 +24,10 @@ load("@lowrisc_bazel_release//:deps.bzl", "lowrisc_bazel_release_deps")
lowrisc_bazel_release_deps()
```

Then, in a `BUILD` file, instantiate the `release` rule:
### Defining the Release

In a `BUILD` file, instantiate the `release` rule and provide the
labels and descriptions of your release artifacts:

```
load("@lowrisc_bazel_release//release:release.bzl", "release")
Expand All @@ -35,6 +40,10 @@ release(
)
```

### Releasing

#### Manual Release

When you want to perform a release, run the `release` target:

```
Expand All @@ -43,3 +52,10 @@ bazel run :release -- <your release tag name>

Bazel will build your release artifacts, and then use the GitHub CLI to
create a release on GitHub and upload your release artifacts.

#### Automation with Github Actions

To create a release via Github actions, execute the release rule
as a step in your workflow configuration. See the
[`create_release.yml`](.github/workflows/create_release.yml) file in
this repository as an example.

0 comments on commit a4b413c

Please sign in to comment.