remove artifacts #1
Workflow file for this run
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: Release relayer and contracts | |
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- "v[0-9]+\\.[0-9]+\\.[0-9]+" # Official release version tags e.g. v2.0.5 | |
- "v[0-9]+\\.[0-9]+\\.[0-9]+-rc[0-9]+" # Release candidate tags e.g. v1.0.3-rc4 | |
- "v[0-9]+\\.[0-9]+\\.[0-9]+-alpha[0-9]+" # Alpha release testing tags e.g. v0.0.3-alpha1 | |
permissions: | |
contents: write | |
id-token: write | |
jobs: | |
goreleaser: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, ubuntu-20.04] | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
cache: true | |
cache-dependency-path: relayer/go.sum | |
- name: Set env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/*}" >> $GITHUB_ENV | |
- name: Check GLIBC version | |
if: startsWith(matrix.os, 'ubuntu-') | |
run: | | |
echo "GLIBC_VERSION=$(ldd --version | grep ldd | awk '{print $NF}')" >> $GITHUB_ENV | |
# Ref: https://goreleaser.com/limitations/semver | |
- name: Tag without prefix locally to avoid error in goreleaser | |
run: |- | |
git tag -d ${{ env.RELEASE_VERSION }} || echo "No such a tag exists before" | |
git tag ${{ env.RELEASE_VERSION }} HEAD | |
- name: Build | |
uses: goreleaser/goreleaser-action@v4 | |
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Enable:ReleaseBuild') | |
with: | |
version: latest | |
args: build --rm-dist --skip-validate # skip validate skips initial sanity checks in order to be able to fully run | |
env: | |
GORELEASER_CURRENT_TAG: ${{ env.RELEASE_VERSION }} | |
GLIBC_VERSION: ${{ env.GLIBC_VERSION }} | |
- name: release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
# Note, we have to pin to v0.179.0 due to newer releases enforcing | |
# correct semantic versioning even when '--skip-validate' is provided. | |
# | |
# Ref: https://github.com/goreleaser/goreleaser/pull/2503 | |
version: v0.179.0 | |
args: release --rm-dist --skip-validate | |
workdir: relayer | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GORELEASER_CURRENT_TAG: ${{ env.RELEASE_VERSION }} | |
GLIBC_VERSION: ${{ env.GLIBC_VERSION }} |