Skip to content

bug: remove type in tool filename #32

bug: remove type in tool filename

bug: remove type in tool filename #32

name: Build and Release
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
#- os: ubuntu-latest
# goos: linux
# goarch: arm64
#- os: macos-latest
# goos: darwin
# goarch: arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Build
run: |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o otto8
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: otto8-${{ matrix.goos }}-${{ matrix.goarch }}
path: otto8
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: ./artifacts/**
update-tap:
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout tap repository
uses: actions/checkout@v4
with:
repository: otto8-ai/homebrew-tap
token: ${{ secrets.GITHUB_TOKEN }}
- name: Calculate SHA256 checksum
id: checksum
run: |
LINUX_SHA256=$(sha256sum ./artifacts/otto8-linux-amd64 | awk '{ print $1 }')
MACOS_SHA256=$(sha256sum ./artifacts/otto8-darwin-amd64 | awk '{ print $1 }')
echo "LINUX_SHA256=$LINUX_SHA256" >> $GITHUB_ENV
echo "MACOS_SHA256=$MACOS_SHA256" >> $GITHUB_ENV
- name: Update Formula
run: |
cp Formula/otto8.rb.tmpl Formula/otto8.rb
sed -i "s/__LINUX_SHA256__/$LINUX_SHA256/g" Formula/otto8.rb
sed -i "s/__MACOS_SHA256__/$MACOS_SHA256/g" Formula/otto8.rb
sed -i "s/__VERSION__/${{ github.run_number }}/g" Formula/otto8.rb
- name: Commit and Push changes
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add .
git commit -m "Update otto8 formula to new version"
git push