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

WIP #4

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: cut new release

on:
schedule:
- cron: '*/10 * * * *'
pull_request:
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Run first script
run: |
./scripts/check-for-update.sh
id: version_check
continue-on-error: true # This allows the workflow to continue even if the script fails
- name: Run second script if the versions differ
if: steps.version_check.outcome == 'failure'
run: |
./scripts/update.sh > Formula/fe.rb
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions Bot"
git checkout -b testbranch
git add .
git commit -m "Automatic commit via GitHub Actions"
git push origin testbranch # Replace with the desired branch
2 changes: 1 addition & 1 deletion Formula/fe.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Fe < Formula

Check failure on line 1 in Formula/fe.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

stable version should not decrease (from 0.24.0 to 0.22.0)
desc "Compiler for the Fe programming language"
homepage "https://github.com/ethereum/fe"
version "0.24.0"
version "0.22.0"

if OS.mac?
url "https://github.com/ethereum/fe/releases/download/v0.24.0/fe_mac"
Expand Down
19 changes: 19 additions & 0 deletions scripts/check-for-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Change the working directory to the script's directory
cd $(dirname "$0") || exit

# Run the first script to get the latest FE version
latest_version=$(./get-latest-fe-version.sh)

# Run the second script to get the formula version
formula_version=$(./get-formula-version.sh)

# Compare the versions
if [ "$latest_version" != "$formula_version" ]; then
echo "Versions differ: Latest version is $latest_version, Formula version is $formula_version"
exit 1
else
echo "Versions are the same: $latest_version"
exit 0
fi
7 changes: 7 additions & 0 deletions scripts/get-formula-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

file_path="../Formula/fe.rb"

# Extract version using grep and awk
version=$(grep -o 'version "[^"]*' "$file_path" | awk -F'"' '{print $2}')
echo $version
1 change: 1 addition & 0 deletions scripts/get-latest-fe-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
echo $(curl -s -L -o /dev/null -w %{url_effective} https://github.com/ethereum/fe/releases/latest | sed 's/.*tag\/v//')
Loading