diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be91485..17cdd92 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: ./scripts/update.sh > Formula/fe.rb git config --global user.email "github-actions-bot@example.com" git config --global user.name "GitHub Actions Bot" - git checkout -b testbranch2 + git checkout -b testbranch3 git add . - git commit -m "Automatic commit via GitHub Actions" - git push origin testbranch2 # Replace with the desired branch \ No newline at end of file + git commit -m "Added new Release via GitHub Actions" + git push origin testbranch3 # Replace with the desired branch \ No newline at end of file diff --git a/Formula/fe.rb b/Formula/fe.rb index fd2c6a4..241335d 100644 --- a/Formula/fe.rb +++ b/Formula/fe.rb @@ -1,15 +1,15 @@ + class Fe < Formula desc "Compiler for the Fe programming language" homepage "https://github.com/ethereum/fe" - version "0.22.0" if OS.mac? - url "https://github.com/ethereum/fe/releases/download/v0.24.0/fe_mac" + url "https://github.com/ethereum/fe/releases/download/v0.22.0/fe_mac" sha256 "a6529f56ad32ed67f387ef85d7fe84f87d302ac12474f8fda93a442836f5073f" end if OS.linux? && Hardware::CPU.intel? - url "https://github.com/ethereum/fe/releases/download/v0.24.0/fe_amd64" + url "https://github.com/ethereum/fe/releases/download/v0.22.0/fe_amd64" sha256 "19a5fb1d9c92302f75a5e1c39f3a47df9c037fd69fc75bb2d5e78823a34ccd36" end diff --git a/scripts/archive-current-formula.sh b/scripts/archive-current-formula.sh index 6e714ab..030abe9 100755 --- a/scripts/archive-current-formula.sh +++ b/scripts/archive-current-formula.sh @@ -7,7 +7,7 @@ cd $(dirname "$0") || exit input_file="../Formula/fe.rb" # Extract the version from the input file -version=$(grep -o 'version "[^"]*' "$input_file" | awk -F'"' '{print $2}') +version=$(grep -o 'v[0-9]\+\.[0-9]\+\.[0-9]\+' "$input_file" | head -n 1 | sed 's/v//') # Check if version is not empty if [ -n "$version" ]; then diff --git a/scripts/get-formula-version.sh b/scripts/get-formula-version.sh index bb0957d..7088b26 100755 --- a/scripts/get-formula-version.sh +++ b/scripts/get-formula-version.sh @@ -1,7 +1,11 @@ #!/bin/bash +# Change the working directory to the script's directory +cd $(dirname "$0") || exit + file_path="../Formula/fe.rb" # Extract version using grep and awk -version=$(grep -o 'version "[^"]*' "$file_path" | awk -F'"' '{print $2}') +#version=$(grep -o 'version "[^"]*' "$file_path" | awk -F'"' '{print $2}') +version=$(grep -o 'v[0-9]\+\.[0-9]\+\.[0-9]\+' "$file_path" | head -n 1 | sed 's/v//') echo $version \ No newline at end of file diff --git a/scripts/update.sh b/scripts/update.sh index 9f4fdb0..18f17ad 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -17,8 +17,7 @@ sha256_mac=$(curl -Ls "$url_mac" | shasum -a 256 | awk '{print $1}') blueprint="class Fe < Formula desc \"Compiler for the Fe programming language\" homepage \"https://github.com/ethereum/fe\" - version \"${version}\" - + if OS.mac? url \"https://github.com/ethereum/fe/releases/download/v${version}/fe_mac\" sha256 \"${sha256_mac}\"