Skip to content

Commit

Permalink
fix action format error
Browse files Browse the repository at this point in the history
  • Loading branch information
tateexon committed May 9, 2024
1 parent 2eed9f3 commit 900d025
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 30 deletions.
38 changes: 17 additions & 21 deletions .github/actions/build_contract_artifacts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,32 @@ runs:
ref: ${{ inputs.ref }}

# temporary docker run to build artifacts
- name: Builder Start
- name: Docker Builder
if: ${{ inputs.image != '' && inputs.image-version != '' }}
env:
image: ${{ inputs.image }}
image_version: ${{ inputs.image-version }}
shell: bash
run: docker run -d -v $(pwd):/repo --name build-container "${image}":"${image_version}" tail -f /dev/null
- name: Docker build
if: ${{ inputs.image != '' && inputs.image-version != '' }}
shell: bash
run: docker exec build-container bash -c "/repo/scripts/build-contract-artifacts-action.sh"
- name: Check generated go bindings are up to date
if: ${{ inputs.image != '' && inputs.image-version != '' }}
shell: bash
run: git diff --stat --exit-code
- name: Docker generate keys and build
if: ${{ inputs.image != '' && inputs.image-version != '' }}
shell: bash
run: |
# start container
docker run -d -v $(pwd):/repo --name build-container "${image}":"${image_version}" tail -f /dev/null
# generate go bindings
docker exec build-container bash -c "/repo/scripts/build-contract-artifacts-action.sh"
# check go bindings
git diff --stat --exit-code
# build with keys
docker exec build-container bash -c "\
export RUSTUP_HOME=\"/root/.rustup\" &&\
cd /repo &&\
./scripts/programs-keys-gen.sh &&\
cd ./contracts &&\
anchor build"
export RUSTUP_HOME=\"/root/.rustup\" &&\
cd /repo &&\
./scripts/programs-keys-gen.sh &&\
cd ./contracts &&\
anchor build"
# clean up the container
docker stop build-container
docker rm build-container
- name: Adjust permissions for artifacts
if: ${{ inputs.image != '' && inputs.image-version != '' }}
run: chmod -R 644 ./contracts/target/deploy/
# fix upload permissions
chown -R $(whoami):$(whoami) ./contracts/target/deploy/
chmod -R 644 ./contracts/target/deploy/
# should be used again after moving from projectserum/build to backpackapp/build
Expand Down
9 changes: 0 additions & 9 deletions scripts/build-contract-artifacts-action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,3 @@ anchor build
cd "${REPO}"
./scripts/anchor-go-gen.sh

# check if the go interfaces have changed
# git diff --stat --exit-code

# # generate program keys
# ./scripts/programs-keys-gen.sh

# # build the contracts with updated keys
# cd "${CONTRACTS}"
# anchor build

0 comments on commit 900d025

Please sign in to comment.