Skip to content

update for mac build #71

update for mac build

update for mac build #71

Workflow file for this run

name: GitHub CI Builder
on:
workflow_dispatch:
inputs:
os_target:
description: 'Choose the OS to build for'
required: true
default: 'ubuntu'
type: choice
options:
- ubuntu
- macos
push:
branches: [main]
jobs:
build:
runs-on: ${{ inputs.os_target == 'macos' && 'macos-latest' || 'ubuntu-22.04' }}
defaults:
run:
shell: bash
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set Build Tag
id: set_tag
run: |
export TAG="v$(date +'%Y%m%d-%H%M')"
echo "TAG_NAME=$TAG" >> $GITHUB_ENV
echo "tag_name=$TAG" >> $GITHUB_OUTPUT
- name: Set Git Identity
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Create Git Tag
run: |
git tag $TAG_NAME
git push origin $TAG_NAME
- name: Make Script Executable
run: |
chmod +x ./build_adventurecoin_ubuntu.sh
chmod +x ./build_adventurecoin_mac.sh
- name: Install Dependencies (Ubuntu)
if: inputs.os_target == 'ubuntu'
run: sudo apt-get update && sudo apt-get install -y imagemagick
- name: Run Ubuntu Build
if: inputs.os_target == 'ubuntu'
run: |
echo -e "2\ny\ny\ny\ny\ny" | ./build_adventurecoin_ubuntu.sh
- name: Remove conflicting Protobuf versions (macOS)
if: inputs.os_target == 'macos'
run: |
brew uninstall --ignore-dependencies protobuf || true
brew cleanup
- name: Run macOS Build
if: inputs.os_target == 'macos'
env:
PATH: "$HOME/local/protobuf-3.6.1/bin:/usr/local/bin:/opt/homebrew/bin:${{ env.PATH }}"
PKG_CONFIG_PATH: "$HOME/local/protobuf-3.6.1/lib/pkgconfig"
LD_LIBRARY_PATH: "$HOME/local/protobuf-3.6.1/lib"
LDFLAGS: "-L$HOME/local/protobuf-3.6.1/lib"
CPPFLAGS: "-I$HOME/local/protobuf-3.6.1/include"
PROTOC: "$HOME/local/protobuf-3.6.1/bin/protoc"
run: |
echo -e "2\ny\ny" | ./build_adventurecoin_mac.sh
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.TAG_NAME }}
name: AdventureCoin ${{ env.TAG_NAME }}
generate_release_notes: true
files: |
./compiled_wallets/*
./compiled_wallets_macos/*
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}