Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Merge pull request #25 from jfrog/feature/alias-list #21

Merge pull request #25 from jfrog/feature/alias-list

Merge pull request #25 from jfrog/feature/alias-list #21

Workflow file for this run

name: Release jfvm to Homebrew
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g. v2.0.0)'
required: true
permissions:
contents: write
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.24'
- name: Determine tag to release
id: tag
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "Detected manual run"
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
else
echo "Detected tag push"
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
- name: Build binary
run: |
mkdir -p dist
go build -o dist/jfvm
- name: Create tarball
run: |
tar -czf jfvm-${{ steps.tag.outputs.tag }}.tar.gz -C dist jfvm
- name: Compute SHA256
id: sha
run: echo "sha=$(shasum -a 256 jfvm-${{ steps.tag.outputs.tag }}.tar.gz | awk '{print $1}')" >> $GITHUB_OUTPUT
- name: Upload GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.tag }}
files: jfvm-${{ steps.tag.outputs.tag }}.tar.gz
token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Homebrew formula
run: |
# Remove 'v' prefix from tag for version
VERSION="${{ steps.tag.outputs.tag }}"
VERSION_NO_V="${VERSION#v}"
cat <<EOF > jfvm.rb
class Jfvm < Formula
desc "Manage multiple versions of JFrog CLI"
homepage "https://github.com/${{ github.repository }}"
url "https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.tag }}/jfvm-${{ steps.tag.outputs.tag }}.tar.gz"
sha256 "${{ steps.sha.outputs.sha }}"
version "${VERSION_NO_V}"
def install
bin.install "jfvm"
end
test do
system "#{bin}/jfvm", "--help"
end
end
EOF
- name: Upload formula to artifacts
uses: actions/upload-artifact@v4.6.2
with:
name: jfvm.rb
path: jfvm.rb
Morty Proxy This is a proxified and sanitized view of the page, visit original site.