Relayer-ubuntu-22.04-Build #20
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
name: Relayer-ubuntu-22.04-Build | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Relayer version (e.g., v1.0.0)' | |
required: true | |
releaseName: | |
description: 'Release name (e.g., v1.0.0)' | |
required: true | |
jobs: | |
setup: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.20' | |
build-router-relayer: | |
needs: setup | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: 'router-protocol/router-relayer' | |
ref: 'main' | |
path: 'router-relayer' | |
token: ${{ secrets.USER_GITHUB_TOKEN }} | |
- name: Build router-relayer | |
run: | | |
cd router-relayer | |
git config --global url."https://ganesh_bhagi:${{secrets.USER_GITHUB_TOKEN}}@github.com/".insteadOf "https://github.com/" | |
git config user.name "Router Protocol" | |
git config user.email "[email protected]" | |
git tag ${{ github.event.inputs.version }} | |
git pull | |
echo "Latest commit hash: $(git log --format="%H" -n 1)" | |
make build-local | |
rm -rf ${{ github.workspace }}/router-chain-binaries/ | |
mkdir -p ${{ github.workspace }}/router-chain-binaries/ | |
tar -czvf router-relayer.tar.gz router-relayer | |
mv router-relayer.tar.gz ${{ github.workspace }}/router-chain-binaries/ | |
- name: Archive router-relayer binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: router-relayer | |
path: ${{ github.workspace }}/router-chain-binaries/router-relayer.tar.gz | |
package-and-push: | |
needs: [build-router-relayer] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Download router-relayer binary | |
uses: actions/download-artifact@v2 | |
with: | |
name: router-relayer | |
path: ${{ github.workspace }}/router-chain-binaries/ | |
- uses: actions/checkout@v3 | |
with: | |
repository: 'router-protocol/router-relayer-binary-release' | |
ref: 'main' | |
path: 'router-relayer-binary-release' | |
token: ${{ secrets.USER_GITHUB_TOKEN }} | |
- name: Package and Push new binaries to the current repository | |
run: | | |
cd router-relayer-binary-release | |
git config --global url."https://ganesh_bhagi:${{secrets.USER_GITHUB_TOKEN}}@github.com/".insteadOf "https://github.com/" | |
git config user.name "Router Protocol" | |
git config user.email "[email protected]" | |
mkdir -p linux | |
echo "SHA256 checksum for the binary: $(sha256sum ${{ github.workspace }}/router-chain-binaries/router-relayer.tar.gz)" | |
rm linux/router-relayer.tar.gz | |
mv ${{ github.workspace }}/router-chain-binaries/router-relayer.tar.gz ./linux/ | |
git add linux/router-relayer.tar.gz | |
git commit -m "Latest relayer executable updated: $(date +'%Y-%m-%d %H:%M:%S')" | |
git push | |
tag-release: | |
needs: package-and-push | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name "Router Protocol" | |
git config user.email "[email protected]" | |
- name: Tag Release | |
run: | | |
git tag -a ${{ github.event.inputs.version }} -m "${{ github.event.inputs.releaseName }}" | |
git push origin ${{ github.event.inputs.version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |