Skip to content

Commit

Permalink
chore: release service-registry 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
maancham committed Jul 24, 2024
1 parent 041fe59 commit edd5eab
Showing 1 changed file with 42 additions and 15 deletions.
57 changes: 42 additions & 15 deletions .github/workflows/build-contracts-and-push-to-r2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
echo "Not a release commit. Skipping crate name and version extraction."
fi
- name: Determine branch
id: get-branch-name
run: |
Expand All @@ -55,6 +56,7 @@ jobs:
fi
echo "branch=$branch" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v4
with:
Expand All @@ -63,21 +65,46 @@ jobs:
submodules: recursive
ref: ${{ steps.get-branch-name.outputs.branch }}

# - name: Compile amplifier contracts
# id: compile-contracts
# run: |
# cd axelar-amplifier
# docker run --rm -v "$(pwd)":/code \
# --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
# --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
# cosmwasm/optimizer:0.16.0
#
# commit_hash=$(git rev-parse --short HEAD)
# cd ..
# mkdir -p ./artifacts/$commit_hash/
# cp -R axelar-amplifier/artifacts/* ./artifacts/$commit_hash/
# echo "wasm-directory=./artifacts" >> $GITHUB_OUTPUT
#

- name: Compile amplifier contracts
id: compile-contracts
run: |
cd axelar-amplifier
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/optimizer:0.16.0
commit_hash=$(git rev-parse --short HEAD)
cd ..
mkdir -p ./artifacts/$commit_hash/
cp -R axelar-amplifier/artifacts/* ./artifacts/$commit_hash/
echo "wasm-directory=./artifacts" >> $GITHUB_OUTPUT
- name: Prepare release artifacts
if: steps.check-release.outputs.is-release == 'true'
id: prepare-release
run: |
cd ${{ steps.compile-contracts.outputs.wasm-directory }}
crate_name="${{ steps.check-release.outputs.crate-name }}"
crate_version="${{ steps.check-release.outputs.crate-version }}"
wasm_file=$(find . -name "${crate_name//-/_}.wasm")
if [ -z "$wasm_file" ]; then
echo "Error: Could not find .wasm file for $crate_name"
exit 1
fi
mkdir -p "../release-artifacts"
cp "$wasm_file" "../release-artifacts/${crate_name}.wasm"
cp checksums.txt "../release-artifacts/"
echo "release-artifacts-dir=./artifacts/release-artifacts" >> $GITHUB_OUTPUT
echo "r2-destination-dir=./releases/amplifier/${crate_name}/${crate_version}" >> $GITHUB_OUTPUT
ls -la ../release-artifacts/
# - uses: ryand56/r2-upload-action@latest
# with:
# r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
Expand Down

0 comments on commit edd5eab

Please sign in to comment.