-
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 branch 'secret' into ani/secretdeviationmod
# Conflicts: # .gitignore # cw-relayer/relayer/relayer.go
- Loading branch information
Showing
13 changed files
with
351 additions
and
109 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,108 @@ | ||
name: Release cw-relayer and contracts | ||
|
||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- "secret-v[0-9]+\\.[0-9]+\\.[0-9]+" # Official release version tags e.g. v2.0.5 | ||
- "secret-v[0-9]+\\.[0-9]+\\.[0-9]+-rc[0-9]+" # Release candidate tags e.g. v1.0.3-rc4 | ||
- "secret-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: | ||
contract: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set env | ||
run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/*}" >> $GITHUB_ENV | ||
|
||
- uses: actions/checkout@v3 | ||
- name: Install latest stable | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
components: rustfmt, clippy | ||
ref: ${{ env.BRANCH_NAME }} | ||
|
||
- name: Set env | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/*}" >> $GITHUB_ENV | ||
|
||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Generate Cargo.lock | ||
run: | | ||
cargo fetch --verbose --manifest-path ./cosmwasm/Cargo.toml | ||
- name: Build/Release Artifacts | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
docker run --rm -v "$(pwd)/cosmwasm":/code \ | ||
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ | ||
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ | ||
cosmwasm/workspace-optimizer:0.12.7 | ||
tar -zcvf cosmwasm-artifacts-${{ env.RELEASE_VERSION }}.tar.gz cosmwasm/artifacts | ||
- name: Release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
cosmwasm-artifacts-${{ env.RELEASE_VERSION }}.tar.gz | ||
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@v4 | ||
with: | ||
go-version: 1.19 | ||
cache: true | ||
cache-dependency-path: cw-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: cw-relayer | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GORELEASER_CURRENT_TAG: ${{ env.RELEASE_VERSION }} | ||
GLIBC_VERSION: ${{ env.GLIBC_VERSION }} | ||
BRANCH_NAME: ${{ env.BRANCH_NAME }} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,4 @@ | ||
docker run --rm -v "$(pwd)/cosmwasm":/code \ | ||
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ | ||
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ | ||
cosmwasm/workspace-optimizer-arm64:0.12.7 |
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,50 @@ | ||
project_name: secret-cw-relayer | ||
|
||
env: | ||
- CGO_ENABLED=1 | ||
|
||
before: | ||
hooks: | ||
- go mod download | ||
|
||
builds: | ||
- main: ./ | ||
id: "secret-cw-relayer" | ||
binary: secret-cw-relayer | ||
mod_timestamp: "{{ .CommitTimestamp }}" | ||
flags: | ||
- -trimpath | ||
ldflags: | ||
- -s -w -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X github.com/ojo-network/contracts/cmd.Version={{ replace .Version "cw-relayer/" "cw-relayer-" }} -X github.com/ojo-network/contracts/cmd.Commit={{ .Commit }} | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
|
||
archives: | ||
- id: bin | ||
format: binary | ||
name_template: "{{ .Binary }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}-glibc-{{.Env.GLIBC_VERSION}}" | ||
|
||
- id: tarball | ||
format: tar.gz | ||
wrap_in_directory: true | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
name_template: '{{ .Binary }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}-glibc-{{.Env.GLIBC_VERSION}}' | ||
files: | ||
- README.md | ||
|
||
release: | ||
disable: false | ||
|
||
snapshot: | ||
name_template: SNAPSHOT-{{ .Commit }} | ||
|
||
checksum: | ||
name_template: 'SHA256SUMS-{{ replace .Version "version/" "cw-relayer-version-" }}-glibc-{{.Env.GLIBC_VERSION}}.txt' | ||
algorithm: sha256 | ||
|
||
changelog: | ||
skip: false |
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
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
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
Oops, something went wrong.