Skip to content

Commit

Permalink
fix: use gwemix version instead of ref name
Browse files Browse the repository at this point in the history
  • Loading branch information
jed-wemade committed Jun 13, 2024
1 parent 224ef34 commit 856e386
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,22 @@ jobs:
- name: Build Go-WEMIX tarball
run: USE_ROCKSDB=YES make gwemix.tar.gz

- name: Stat Go-WEMIX tarball
- name: Set version
run: |
ls -l build/gwemix.tar.gz
tar tf build/gwemix.tar.gz
GWEMIX_VERSION_META="v$(build/bin/gwemix version | awk '/^Version/{ print $2 }')"
echo "GWEMIX_VERSION_META=$GWEMIX_VERSION_META" >> "$GITHUB_ENV"
echo "GWEMIX_VERSION=$(echo $GWEMIX_VERSION_META | cut -d'-' -f1)" >> "$GITHUB_ENV"
echo "GWEMIX_META=$(echo $GWEMIX_VERSION_META | cut -d'-' -f2-)" >> "$GITHUB_ENV"
echo "GWEMIX_COMMITHASH=$(echo ${{ github.sha }} | cut -c1-8)" >> "$GITHUB_ENV"
- name: Display ELF info
run: readelf -dV build/bin/gwemix

- name: Move results to artifact
run: mv build/gwemix.tar.gz gwemix-${{ github.ref_name }}-${{ github.sha }}-linux-amd64-rocksdb.tar.gz
run: mv build/gwemix.tar.gz gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz

- name: Upload Go-WEMIX
uses: actions/upload-artifact@v4
with:
name: artifact-${{ github.ref_name }}-${{ github.sha }}
path: gwemix-${{ github.ref_name }}-${{ github.sha }}-linux-amd64-rocksdb.tar.gz
name: artifact-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}
path: gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz
18 changes: 13 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@ jobs:
- name: Build Go-WEMIX tarball (rocksdb)
run: USE_ROCKSDB=YES make gwemix.tar.gz

- name: Set version
run: |
GWEMIX_VERSION_META="v$(build/bin/gwemix version | awk '/^Version/{ print $2 }')"
echo "GWEMIX_VERSION_META=$GWEMIX_VERSION_META" >> "$GITHUB_ENV"
echo "GWEMIX_VERSION=$(echo $GWEMIX_VERSION_META | cut -d'-' -f1)" >> "$GITHUB_ENV"
echo "GWEMIX_META=$(echo $GWEMIX_VERSION_META | cut -d'-' -f2-)" >> "$GITHUB_ENV"
echo "GWEMIX_COMMITHASH=$(echo ${{ github.sha }} | cut -c1-8)" >> "$GITHUB_ENV"
- name: Display ELF info (rocksdb)
run: readelf -dV build/bin/gwemix

- name: Move results to artifact (rocksdb)
run: mv build/gwemix.tar.gz gwemix-${{ github.ref_name }}-${{ github.sha }}-linux-amd64-rocksdb.tar.gz
run: mv build/gwemix.tar.gz gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz

- name: Build Go-WEMIX tarball (leveldb)
run: USE_ROCKSDB=NO make gwemix.tar.gz
Expand All @@ -38,13 +46,13 @@ jobs:
run: readelf -dV build/bin/gwemix

- name: Move results to artifact (leveldb)
run: mv build/gwemix.tar.gz gwemix-${{ github.ref_name }}-${{ github.sha }}-linux-amd64-leveldb.tar.gz
run: mv build/gwemix.tar.gz gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-leveldb.tar.gz

- name: GH Release
uses: softprops/action-gh-release@v2.0.5
with:
name: WEMIX3.0 Mainnet and Testnet Build (${{ github.ref_name }})
name: WEMIX3.0 Mainnet and Testnet Build (${{ env.GWEMIX_VERSION }})
draft: true
files: |
gwemix-${{ github.ref_name }}-${{ github.sha }}-linux-amd64-rocksdb.tar.gz
gwemix-${{ github.ref_name }}-${{ github.sha }}-linux-amd64-leveldb.tar.gz
gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz
gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-leveldb.tar.gz

0 comments on commit 856e386

Please sign in to comment.