Skip to content

release relayer

release relayer #1

name: relayer
on:
push:
branches:
- main
- release-v1.0.0
- clara/release-relayer
workflow_dispatch:
jobs:
build:
runs-on: snowbridge-runner
timeout-minutes: 15
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Setup go
uses: actions/checkout@v4
with:
go-version: '^1.21.0'
- name: Install Go tools
run: >
go install github.com/magefile/[email protected] &&
go install github.com/ferranbt/fastssz/[email protected]
go install github.com/ethereum/go-ethereum/cmd/abigen@latest
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Build contracts
working-directory: contracts
run: forge build
- name: install dependencies
working-directory: relayer
run: go mod download
- name: Add gopath to bin
run: echo "$HOME/go/bin" >> $GITHUB_PATH
- name: build
working-directory: relayer
run: mage build
- name: Configure Git
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
- name: Create a new release version
id: new_version
run: |
current_version=$(git describe --tags $(git rev-list --tags --max-count=1) 2>/dev/null || echo "")
echo "Current version: $current_version"
# If there is no current version, set it to v1.0.0
if [ -z "$current_version" ]; then
new_version="v1.0.0"
else
new_version=$(npx semver $current_version -i patch)
fi
echo "New version: $new_version"
echo ::set-output name=version::$new_version
git tag $new_version
- name: Create new tag
id: create_tag
run: |
tag_name="${{ steps.branch_name.outputs.branch }}-${{ steps.new_version.outputs.version }}"
echo "Tag name: $tag_name"
echo ::set-output name=tag::$tag_name
git tag $tag_name
- name: Push new tag
run: |
git push origin --tags
- name: Create a GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.create_tag.outputs.tag }}
release_name: ${{ steps.create_tag.outputs.tag }}
body: |
Changes in this release:
- ...
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./relayer/build
asset_name: snowbridge-relay
asset_content_type: application/octet-stream