Skip to content

Commit

Permalink
Add release ci (#102)
Browse files Browse the repository at this point in the history
* Create release.yml

* fix: typo

* fix: remove sha

* fix: specify ubuntu version in ci files

* fix: setup packages in ci files to match dependency

* fix: integrate file name rule to keep consistency between ci files

* fix: use gwemix version instead of ref name
  • Loading branch information
jed-wemade authored Jun 13, 2024
1 parent 8ae9c1b commit 8cfed0d
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 7 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:

build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

Expand All @@ -18,19 +18,30 @@ jobs:
with:
go-version: '1.19'

- name: Setup packages
run: |
sudo apt install -y libjemalloc-dev liblz4-dev libsnappy-dev libzstd-dev libudev-dev
sudo apt remove -y bzip2 libbz2-dev zlib1g-dev
- 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
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "Release a tag as draft"

on:
push:
tags:
- w*

jobs:

build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19'

- name: Setup packages
run: |
sudo apt install -y libjemalloc-dev liblz4-dev libsnappy-dev libzstd-dev libudev-dev
sudo apt remove -y bzip2 libbz2-dev zlib1g-dev
- 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-${{ 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

- name: Display ELF info (leveldb)
run: readelf -dV build/bin/gwemix

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

- name: GH Release
uses: softprops/[email protected]
with:
name: WEMIX3.0 Mainnet and Testnet Build (${{ env.GWEMIX_VERSION }})
draft: true
files: |
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 8cfed0d

Please sign in to comment.