-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50d06cf
commit 991135b
Showing
1 changed file
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
upload: | ||
strategy: | ||
matrix: | ||
include: | ||
- target: aarch64-apple-darwin | ||
os: macos-latest | ||
short-name: macos-arm64 | ||
- target: x86_64-apple-darwin | ||
os: macos-13 | ||
short-name: macos-i64 | ||
- target: x86_64-unknown-linux-musl | ||
os: ubuntu-latest | ||
short-name: linux-i64 | ||
|
||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Vlang | ||
run: | | ||
git clone --depth=1 https://github.com/vlang/v | ||
cd v | ||
make | ||
sudo ./v symlink | ||
cd .. | ||
- name: Setup Herolib | ||
run: | | ||
mkdir -p ~/.vmodules/freeflowuniverse | ||
ln -s $GITHUB_WORKSPACE/lib ~/.vmodules/freeflowuniverse/herolib | ||
echo "Installing secp256k1..." | ||
if [[ ${{ matrix.os }} == 'macos-latest' || ${{ matrix.os }} == 'macos-13' ]]; then | ||
brew install secp256k1 | ||
elif [[ ${{ matrix.os }} == 'ubuntu-latest' ]]; then | ||
# Install build dependencies | ||
sudo apt-get install -y build-essential wget autoconf libtool | ||
# Download and extract secp256k1 | ||
cd /tmp | ||
wget https://github.com/bitcoin-core/secp256k1/archive/refs/tags/v0.3.2.tar.gz | ||
tar -xvf v0.3.2.tar.gz | ||
# Build and install | ||
cd secp256k1-0.3.2/ | ||
./autogen.sh | ||
./configure | ||
make -j 5 | ||
sudo make install | ||
else | ||
echo "Unsupported OS: ${{ matrix.os }}" | ||
exit 1 | ||
fi | ||
echo "secp256k1 installation complete!" | ||
- name: Build Hero | ||
run: | | ||
v -w -cg -gc none -no-retry-compilation -d use_openssl -enable-globals cli/hero.v -o cli/hero-${{ matrix.target }} | ||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: hero-${{ matrix.target }} | ||
path: cli/hero-${{ matrix.target }} | ||
|
||
release_hero: | ||
needs: upload | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
|
||
# TODO: this adds commits that don't belong to this branhc, check another action | ||
# - name: Generate changelog | ||
# id: changelog | ||
# uses: heinrichreimer/[email protected] | ||
# with: | ||
# token: ${{ secrets.GITHUB_TOKEN }} | ||
# headerLabel: "# 📑 Changelog" | ||
# breakingLabel: "### 💥 Breaking" | ||
# enhancementLabel: "### 🚀 Enhancements" | ||
# bugsLabel: "### 🐛 Bug fixes" | ||
# securityLabel: "### 🛡️ Security" | ||
# issuesLabel: "### 📁 Other issues" | ||
# prLabel: "### 📁 Other pull requests" | ||
# addSections: '{"documentation":{"prefix":"### 📖 Documentation","labels":["documentation"]},"tests":{"prefix":"### ✅ Testing","labels":["tests"]}}' | ||
# onlyLastTag: true | ||
# issues: false | ||
# issuesWoLabels: false | ||
# pullRequests: true | ||
# prWoLabels: true | ||
# author: true | ||
# unreleased: true | ||
# compareLink: true | ||
# stripGeneratorNotice: true | ||
# verbose: true | ||
|
||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: cli/bins | ||
merge-multiple: true | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
name: Release ${{ github.ref_name }} | ||
draft: false | ||
fail_on_unmatched_files: true | ||
# body: ${{ steps.changelog.outputs.changelog }} | ||
files: cli/bins/* |