-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from fe-lang/christoph/ci-releases
- Loading branch information
Showing
7 changed files
with
116 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: cut new release | ||
|
||
on: | ||
schedule: | ||
- cron: '*/15 * * * *' | ||
|
||
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 | ||
- name: Run second script if the versions differ | ||
run: | | ||
./scripts/archive-current-formula.sh | ||
./scripts/update.sh > Formula/fe.rb | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions Bot" | ||
git add . | ||
git commit -m "Added new Release via GitHub Actions" | ||
git push origin main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# Change the working directory to the script's directory | ||
cd $(dirname "$0") || exit | ||
|
||
# Path to the input file | ||
input_file="../Formula/fe.rb" | ||
|
||
# Extract the version from the input file | ||
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 | ||
# Define the new filename | ||
new_filename="../Formula/fe@${version}.rb" | ||
|
||
# Check if the new filename already exists | ||
if [ -e "$new_filename" ]; then | ||
echo "File '$new_filename' already exists." | ||
else | ||
# Rename the file | ||
mv "$input_file" "$new_filename" | ||
echo "File renamed to '$new_filename'." | ||
fi | ||
else | ||
echo "Version not found in the file." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# 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 0 | ||
else | ||
echo "Versions are the same: $latest_version" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/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 'v[0-9]\+\.[0-9]\+\.[0-9]\+' "$file_path" | head -n 1 | sed 's/v//') | ||
echo $version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
# Change the working directory to the script's directory | ||
cd $(dirname "$0") || exit | ||
|
||
# Define your GitHub repository owner and name | ||
repo_owner="ethereum" | ||
repo_name="fe" | ||
|
||
# Make the API request and store the response in a variable | ||
response=$(curl -s "https://api.github.com/repos/$repo_owner/$repo_name/releases/latest") | ||
|
||
# Check if the request was successful (HTTP status code 200) | ||
if [[ $? -eq 0 ]]; then | ||
# Extract the "name" field from the JSON response | ||
name=$(echo "$response" | jq -r ".name") | ||
|
||
# Remove a leading "v" from the name (if present) | ||
name_without_v="${name#v}" | ||
|
||
# Print the modified name | ||
echo $name_without_v | ||
else | ||
echo "Failed to fetch latest release." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters