Skip to content

Commit

Permalink
Update build-darwin-arm64.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
LizJeong authored Jul 18, 2024
1 parent 72e5299 commit f6be8a9
Showing 1 changed file with 6 additions and 38 deletions.
44 changes: 6 additions & 38 deletions .github/workflows/build-darwin-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: '1.22.4'
- name: Ensure dependencies and update movevm
run: |
go mod tidy
go get github.com/initia-labs/movevm@latest
- name: Set environment variables
run: |
L1_NETWORK_NAME="initiation-1"
echo "L1_NETWORK_NAME=${L1_NETWORK_NAME}" >> $GITHUB_ENV
# Read MOVEVM_VERSION from config file
MOVEVM_VERSION=$(grep MOVEVM_VERSION $GITHUB_WORKSPACE/.github/workflows/config | cut -d '=' -f2)
# Read MOVEVM_VERSION from go.mod file
MOVEVM_VERSION=$(go list -m github.com/initia-labs/movevm | awk '{print $2}')
echo "MOVEVM_VERSION=${MOVEVM_VERSION}" >> $GITHUB_ENV
echo "GOARCH=${{ inputs.arch }}" >> $GITHUB_ENV
echo "GOOS=darwin" >> $GITHUB_ENV
Expand All @@ -38,26 +42,13 @@ jobs:
echo "ARCH_NAME=aarch64" >> $GITHUB_ENV
else
echo "ARCH_NAME=${{ inputs.arch }}" >> $GITHUB_ENV
fi
- name: Ensure dependencies
run: go mod tidy
- name: Print environment variables
run: |
echo "GOARCH=${GOARCH}"
echo "GOOS=${GOOS}"
echo "VERSION=${VERSION}"
echo "ARCH_NAME=${ARCH_NAME}"
echo "L1_NETWORK_NAME=${L1_NETWORK_NAME}"
# - name: Build for Darwin ARM64
# run: |
# go build -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=initia -X github.com/cosmos/cosmos-sdk/version.AppName=initiad -X github.com/cosmos/cosmos-sdk/version.Version=${VERSION} -X github.com/cosmos/cosmos-sdk/version.Commit=${GITHUB_SHA} -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger" -X github.com/cometbft/cometbft/version.TMCoreSemVer=v0.0.0-20240704071957-c46468756c01 -w -s' -trimpath -o build/initiad ./cmd/initiad
# cd ./build
# mkdir -p initia_${VERSION}
# cp ~/go/pkg/mod/github.com/initia-labs/movevm@${MOVEVM_VERSION}/api/libmovevm.dylib initia_${VERSION}/libmovevm.${ARCH_NAME}.dylib
# cp ~/go/pkg/mod/github.com/initia-labs/movevm@${MOVEVM_VERSION}/api/libcompiler.dylib initia_${VERSION}/libcompiler.${ARCH_NAME}.dylib
# mv initiad initia_${VERSION}/
# tar -czvf initia_${VERSION}_Darwin_${ARCH_NAME}.tar.gz initia_${VERSION}

- name: Build and Package for Darwin ARM64
run: |
cd ../initia \
Expand All @@ -76,26 +67,3 @@ jobs:
initia_${{ env.VERSION }}_Darwin_${{ env.ARCH_NAME }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Google Auth
# uses: 'google-github-actions/auth@v2'
# with:
# credentials_json: '${{ secrets.GCP_SA_KEY }}'
# - name: Set up Cloud SDK
# uses: 'google-github-actions/setup-gcloud@v2'
# - name: Upload to GCS
# env:
# GCS_BUCKET: ${{ secrets.GCS_BUCKET }}
# run: |
# gsutil cp ./build/initia_${VERSION}_Darwin_${ARCH_NAME}.tar.gz gs://${GCS_BUCKET}/initia/
# - name: Verify upload and Generate public URL
# env:
# GCS_BUCKET: ${{ secrets.GCS_BUCKET }}
# run: |
# if gsutil stat gs://${GCS_BUCKET}/initia/initia_${VERSION}_Darwin_${ARCH_NAME}.tar.gz; then
# echo "File successfully uploaded"
# echo "Public URL: https://storage.googleapis.com/${GCS_BUCKET}/initia/initia_${VERSION}_Darwin_${ARCH_NAME}.tar.gz" >> $GITHUB_STEP_SUMMARY
# else
# echo "File upload failed"
# exit 1
# fi

0 comments on commit f6be8a9

Please sign in to comment.