Skip to content

Create Bump Pull Request #29

Create Bump Pull Request

Create Bump Pull Request #29

name: Create Bump Pull Request
on:
workflow_dispatch:
inputs:
tag:
description: Ockam Tag To Update Homebrew To. e.g. ockam_v0.59.0
required: true
binaries:
description: Ockam Binaries And Their Image SHA
required: true
branch_name:
description: New Branch To Bump Crates
required: true
permissions:
# Allows us write to the repo
contents: write
# Actions permission allows us create pull requests.
pull-requests: write
jobs:
update_homebrew:
name: Update Home Brew Version
runs-on: ubuntu-20.04
environment: release
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
with:
fetch-depth: 0
- name: Import GPG key
uses: build-trust/.github/actions/import_gpg@custom-actions
with:
gpg_private_key: '${{ secrets.GPG_PRIVATE_KEY }}'
gpg_password: '${{ secrets.GPG_PASSPHRASE }}'
gpg_name: '${{ secrets.GPG_USER_NAME }}'
gpg_email: '${{ secrets.GPG_EMAIL }}'
- name: Checkout To New Branch
run: git checkout -B ${{ github.event.inputs.branch_name }}
- name: Update File With Specified SHASum256
shell: bash
run: |
set -x
temp_dir=$(mktemp -d)
cp .github/ockam.rb.template $temp_dir/ockam.rb
cp .github/portals.rb.template $temp_dir/portals.rb
cd $temp_dir
binaries=(${{ github.event.inputs.binaries }})
for binary in ${binaries[@]}; do
echo "$binary"
file=(${binary//:/ })
echo "${file[@]}"
if [[ ${file[0]} == *".so"* || ${file[0]} == *".sig"* ]]; then
echo "elixir nif library found, skipping."
continue
fi
sed -i "s/${file[0]}_sha256_value/${file[1]}/g" ockam.rb
sed -i "s/${file[0]}_sha256_value/${file[1]}/g" portals.rb
done
sed -i "s/release_tag/${{ github.event.inputs.tag }}/g" ockam.rb
sed -i "s/release_tag/${{ github.event.inputs.tag }}/g" portals.rb
cp ockam.rb $GITHUB_WORKSPACE/ockam.rb
cp portals.rb $GITHUB_WORKSPACE/Casks/portals.rb
cat ockam.rb
- name: Push Update
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add ockam.rb
git add Casks/portals.rb
git commit -S -m "ci: update to release ${{ github.event.inputs.tag }}"
git push --set-upstream origin ${{ github.event.inputs.branch_name }}