-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a release workflow for publishing to bazel-central-registry
To publish a release: 1. Tag a commit matching the v2.* pattern 2. Review and publish the draft github release created by the workflow
- Loading branch information
Showing
7 changed files
with
109 additions
and
4 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"homepage": "https://github.com/rabbitmq/ra", | ||
"maintainers": [ | ||
{ | ||
"email": "[email protected]", | ||
"github": "kjnilsson", | ||
"name": "Karl Nilsson" | ||
}, | ||
{ | ||
"email": "[email protected]", | ||
"github": "pjk25", | ||
"name": "Rin Kuryloski" | ||
} | ||
], | ||
"repository": [ | ||
"github:rabbitmq/ra" | ||
], | ||
"versions": [], | ||
"yanked_versions": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
shell_commands: &shell_commands | ||
- curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl | ||
- chmod a+x kerl | ||
- ./kerl update releases | ||
- ./kerl build ${ERLANG_VERSION} | ||
- ./kerl install ${ERLANG_VERSION} ~/kerl/${ERLANG_VERSION} | ||
- realpath ~/kerl/${ERLANG_VERSION} | ||
|
||
platforms: | ||
macos: | ||
environment: | ||
ERLANG_VERSION: "25.0" | ||
ERLANG_HOME: /Users/buildkite/kerl/25.0 | ||
shell_commands: *shell_commands | ||
build_flags: | ||
- --incompatible_strict_action_env | ||
build_targets: | ||
- '@rabbitmq_ra//:erlang_app' | ||
ubuntu2004: | ||
environment: | ||
ERLANG_VERSION: "25.0" | ||
ERLANG_HOME: /var/lib/buildkite-agent/kerl/25.0 | ||
shell_commands: *shell_commands | ||
build_flags: | ||
- --incompatible_strict_action_env | ||
build_targets: | ||
- '@rabbitmq_ra//:erlang_app' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"integrity": "", | ||
"strip_prefix": "{REPO}-{VERSION}", | ||
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/ra-{VERSION}.tar.gz" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- v2.* | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: CHECKOUT | ||
uses: actions/checkout@v3 | ||
with: | ||
path: ra | ||
- name: ASSERT VERSIONS | ||
id: versions | ||
working-directory: ra | ||
run: | | ||
sudo npm install --global --silent @bazel/buildozer | ||
VERSION_APP_SRC="$(erl -eval '{ok, [{application, _, AppInfo}]} = file:consult("src/ra.app.src"), Version = proplists:get_value(vsn, AppInfo), io:fwrite(Version), halt().' -noshell)" | ||
if [[ "${{ github.ref_name }}" != "v$VERSION_APP_SRC" ]]; then | ||
echo "Version in src/ra.app.src ($VERSION_APP_SRC) does not match tag (${{ github.ref_name }})" | ||
exit 1 | ||
fi | ||
VERSION_BAZEL="$(cat MODULE.bazel | buildozer 'print version' -:%module)" | ||
if [[ "${{ github.ref_name }}" != "v$VERSION_BAZEL" ]]; then | ||
echo "Version in MODULE.bazel ($VERSION_BAZEL) does not match tag (${{ github.ref_name }})" | ||
exit 1 | ||
fi | ||
echo "version=$VERSION_BAZEL" | tee -a $GITHUB_OUTPUT | ||
- name: FETCH THE SOURCE ARCHIVE | ||
run: | | ||
curl \ | ||
-L \ | ||
-o ra-${{ steps.versions.outputs.version }}.tar.gz \ | ||
https://github.com/${{ github.repository }}/archive/${{ github.ref }}.tar.gz | ||
- name: CREATE RELEASE | ||
id: create-release | ||
uses: ncipollo/[email protected] | ||
with: | ||
allowUpdates: true | ||
draft: true | ||
artifactErrorsFailBuild: true | ||
updateOnlyUnreleased: true | ||
generateReleaseNotes: true | ||
artifacts: >- | ||
ra-${{ steps.versions.outputs.version }}.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
workspace(name = "rabbitmq_ra") | ||
|
||
load( | ||
"@bazel_tools//tools/build_defs/repo:http.bzl", | ||
"http_archive", | ||
|