Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds step to bump homebrew formula #726

Closed
wants to merge 44 commits into from
Closed
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b6e64f4
adds step to bump homebrew formula
shahadarsh Apr 20, 2024
08baa79
adds step to bump homebrew formula
shahadarsh Apr 20, 2024
3211dde
adds step to bump homebrew formula
shahadarsh Apr 20, 2024
613396e
uses prerelease flag for release
shahadarsh Apr 21, 2024
52e5bc9
adds download url & tap details
shahadarsh Apr 21, 2024
dafe932
adds download url & tap details
shahadarsh Apr 21, 2024
8c20711
adds download url & tap details
shahadarsh Apr 21, 2024
96333a7
triggers tembo release when Cargo.toml for cli is changed
shahadarsh Apr 22, 2024
38e17b2
test trigger
shahadarsh Apr 22, 2024
5e69035
test trigger
shahadarsh Apr 22, 2024
7da6a11
test trigger
shahadarsh Apr 22, 2024
0f6343b
runs bump step after matrix is done
shahadarsh Apr 22, 2024
16e6b2d
test trigger
shahadarsh Apr 22, 2024
efc64db
adds runs-on
shahadarsh Apr 22, 2024
d93ce5a
test trigger
shahadarsh Apr 22, 2024
c749e11
fixes org
shahadarsh Apr 22, 2024
66a18cc
test trigger
shahadarsh Apr 22, 2024
21a2b03
uses different gh action
shahadarsh Apr 22, 2024
c8e8c89
uses other secret
shahadarsh Apr 22, 2024
a8857f8
test trigger
shahadarsh Apr 22, 2024
77fbaca
tries adding step
shahadarsh Apr 22, 2024
8661bb4
tries adding step
shahadarsh Apr 22, 2024
9519cce
tries using bash to update homebrew
shahadarsh Apr 22, 2024
5a1b4a0
test trigger
shahadarsh Apr 22, 2024
37eb5fa
tries using bash to update homebrew
shahadarsh Apr 22, 2024
bce4762
test trigger
shahadarsh Apr 22, 2024
1d09dd6
tries using bash to update homebrew
shahadarsh Apr 22, 2024
8094123
test trigger
shahadarsh Apr 22, 2024
66785de
tries using bash to update homebrew
shahadarsh Apr 22, 2024
6f3269d
test trigger
shahadarsh Apr 22, 2024
34f5e23
tries using bash to update homebrew
shahadarsh Apr 22, 2024
801e94a
test trigger
shahadarsh Apr 22, 2024
baf262c
tries using bash to update homebrew
shahadarsh Apr 22, 2024
d15a909
test trigger
shahadarsh Apr 22, 2024
4ee2999
replaces sha256 in Formula
shahadarsh Apr 23, 2024
808ea62
test trigger
shahadarsh Apr 23, 2024
1c33e4b
replaces sha256 in Formula
shahadarsh Apr 23, 2024
ba0b940
test trigger
shahadarsh Apr 23, 2024
5e65cac
replaces sha256 in Formula
shahadarsh Apr 23, 2024
4fee9fa
test trigger
shahadarsh Apr 23, 2024
87469d5
replaces sha256 in Formula
shahadarsh Apr 23, 2024
fdce944
test trigger
shahadarsh Apr 23, 2024
6ffa345
replaces sha256 in Formula
shahadarsh Apr 23, 2024
7236c4f
test trigger 2
shahadarsh Apr 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 94 additions & 6 deletions .github/workflows/tembo_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ permissions:

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
branches:
- bump-homebrew-formula
paths:
- 'tembo-cli/Cargo.toml'

jobs:

cargo_build:
name: Cargo build
gh_release:
name: Github Release
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -39,6 +41,11 @@ jobs:
os: windows-latest
executable: tembo.exe
runs-on: ${{ matrix.os }}
outputs:
version: ${{ steps.cli_version_mac.outputs.version }}
release_version: ${{ steps.set_release_version.outputs.release_version }}
sha_x86_64: ${{ steps.fetch_sha256.outputs.sha_x86_64 }}
sha_aarch64: ${{ steps.fetch_sha256.outputs.sha_aarch64 }}
container:
image: ${{ matrix.container }}
steps:
Expand All @@ -63,14 +70,29 @@ jobs:
tar -czvf tembo.tar.gz ${{ matrix.executable }}
git config --global --add safe.directory '*'

- name: Fetch sha256
working-directory: ./tembo-cli
id: fetch_sha256
run: |
sha_256=$(shasum -a 256 target/${{ matrix.target }}/release/tembo.tar.gz | cut -d" " -f 1)
if [[ ${{ matrix.target }} == "x86_64-apple-darwin" ]]
then
echo "sha_x86_64=$sha_256" >> $GITHUB_OUTPUT
elif [[ ${{ matrix.target }} == "aarch64-apple-darwin" ]]
echo "sha_aarch64=$sha_256" >> $GITHUB_OUTPUT
fi
if: runner.os == 'macOS'

# TODO: Figure out a better way to fetch version for mac & linux
- name: CLI version Mac
working-directory: ./tembo-cli
id: cli_version_mac
run: |
cargo install cargo-get
TEMBO_CLI_NAME=$(cargo-get package.name)-$(cargo-get package.version)
VERSION=$(cargo-get package.version)
TEMBO_CLI_NAME=$(cargo-get package.name)-$VERSION
echo "TEMBO_CLI_NAME=$TEMBO_CLI_NAME" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
if: runner.os == 'macOS'

- name: CLI version Linux
Expand Down Expand Up @@ -100,11 +122,77 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: set env non-windows
id: set_release_version
run: |
RELEASE_VERSION=$(date +'%Y.%m.%d')
echo "NOW=$RELEASE_VERSION" >> $GITHUB_ENV
echo "release_version=$RELEASE_VERSION" >> $GITHUB_OUTPUT
if: runner.os != 'Windows'

- name: set env windows
run: echo "NOW=$(date +'%Y.%m.%d')" >> $env:GITHUB_ENV
if: runner.os == 'Windows'

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: tembo-cli/target/${{ matrix.target }}/release/tembo.tar.gz
asset_name: ${{ env.TEMBO_CLI_NAME }}-${{ matrix.asset_name }}.tar.gz
tag: ${{ github.ref }}
prerelease: true
tag: ${{ env.NOW }}
body: ${{ steps.changelog.outputs.changelog }}

post_gh_release:
runs-on: macos-latest
needs: gh_release
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
repository: tembo-io/homebrew-tembo
ssh-key: ${{ secrets.SERVICE_USER_GITHUB_SSH_KEY }}
path: homebrew-tembo
- name: Git commit and push to remote
shell: bash
run: |
set -xe
cd homebrew-tembo
git config --global user.name "coredb-service-user"
git config --global user.email "[email protected]"
git fetch origin test-bump && git checkout test-bump || git checkout -b test-bump
- name: Replace version
shell: bash
run: |
set -xe
cd homebrew-tembo
sed -E -i '' 's/version ".*/version "${{needs.gh_release.outputs.version}}"/g' tembo-cli.rb
- name: Replace release_version
shell: bash
run: |
set -xe
cd homebrew-tembo
sed -E -i '' 's/release_version =.*/release_version = "${{needs.gh_release.outputs.release_version}}"/g' tembo-cli.rb
- name: Replace sha_x86_64
shell: bash
run: |
set -xe
cd homebrew-tembo
sed -E -i '' 's/sha256.*/sha256 "${{needs.gh_release.outputs.sha_x86_64}}"/g' tembo-cli.rb
- name: Replace sha_aarch_64
shell: bash
run: |
set -xe
cd homebrew-tembo
sed -E -i '' '1,/sha256.*/ s/sha256.*/sha256 "${{needs.gh_release.outputs.sha_aarch_64}}"/g' tembo-cli.rb
- name: Git commit and push to remote
shell: bash
run: |
set -xe
cd homebrew-tembo
git add --all
# debugging
git diff HEAD
git commit -m "Update from tembo-io/tembo: ${{ inputs.version }}"
git push origin test-bump
Loading