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

IZE-645 ize homebrew version automated #553

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Changes from all commits
Commits
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
46 changes: 46 additions & 0 deletions .github/workflows/release-prod.build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,52 @@ jobs:
user_name: 'ize'
commit_message: 'Add commands from Ize'

create_numbered_brew_version:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout current repository
uses: actions/checkout@v2

- name: Checkout homebrew-ize repository
uses: actions/checkout@v2
with:
repository: hazelops/homebrew-ize # Ize homebrew repo
path: ${{ github.workspace }}/homebrew-ize # Local folder to copy file

- name: Extract version from ize.rb
id: extract_version
run: |
# Extract string with version
version=$(grep -Po 'version "\K[0-9.]+' ${{ github.workspace }}/homebrew-ize/ize.rb)
version_no_dots=$(echo $version | tr -d '.')
echo "Version extracted: $version, Version without dots: $version_no_dots"
# Set version as output
echo "::set-output name=version::$version"
echo "::set-output name=version_no_dots::$version_no_dots"

- name: Update class name in ize.rb
run: |
# Change string "class Ize < Formula" to "class Ize<version> < Formula" in the file
sed -i "s/class Ize < Formula/class Ize${{ steps.extract_version.outputs.version_no_dots }} < Formula/" ${{ github.workspace }}/homebrew-ize/ize.rb

- name: Rename file to include version
run: |
# Rename ize.rb to ize-<version>.rb
mv ${{ github.workspace }}/homebrew-ize/ize.rb ${{ github.workspace }}/homebrew-ize/ize-${{ steps.extract_version.outputs.version }}.rb

- name: Commit and Push changes
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
with:
source_file: '${{ github.workspace }}/homebrew-ize/ize-${{ steps.extract_version.outputs.version }}.rb'
destination_repo: 'hazelops/homebrew-ize'
destination_folder: '/'
user_email: '[email protected]'
user_name: 'ize'
commit_message: 'Updated class name and renamed ize.rb to ize-${{ steps.extract_version.outputs.version }}.rb'

create_jira_release:
needs: build
runs-on: ubuntu-latest
Expand Down
Loading