forked from lthn/blockchain
Split build jobs by architecture and OS in GitHub Actions workflows, add Docker and docs build jobs, and update artifact upload to create GitHub releases. Also update CPackConfig.cmake to use BUILD_VERSION for package versioning.
79 lines
2.4 KiB
YAML
79 lines
2.4 KiB
YAML
name: Push Full Build
|
|
permissions:
|
|
contents: read
|
|
on:
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
release:
|
|
types: [ published ]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
determine-network:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
chain-network: ${{ steps.get_branch.outputs.chain_network }}
|
|
steps:
|
|
- name: Get release information from API
|
|
id: get_branch
|
|
run: |
|
|
# Use the GitHub CLI to get the release details by tag name
|
|
# The result is a JSON object
|
|
RELEASE_INFO=$(gh release view --json targetCommitish -t ${{ github.ref_name }})
|
|
|
|
# Extract the target commitish (the source branch)
|
|
SOURCE_BRANCH=$(echo "$RELEASE_INFO" | jq -r '.targetCommitish')
|
|
|
|
# Set the chain network based on the source branch
|
|
if [ "$SOURCE_BRANCH" == "dev" ]; then
|
|
echo "chain_network=testnet" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "chain_network=mainnet" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
echo "Source Branch: $SOURCE_BRANCH"
|
|
echo "Chain Network: ${{ steps.get_branch.outputs.chain_network }}"
|
|
|
|
build-linux-intel:
|
|
name: Chain
|
|
uses: ./.github/workflows/build-linux-intel.yml
|
|
with:
|
|
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
|
|
|
|
build-linux-arm:
|
|
name: Chain
|
|
uses: ./.github/workflows/build-linux-arm64.yml
|
|
with:
|
|
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
|
|
|
|
build-windows-intel:
|
|
name: Chain
|
|
uses: ./.github/workflows/build-windows-intel.yml
|
|
with:
|
|
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
|
|
|
|
build-macos-arm64:
|
|
name: Chain
|
|
uses: ./.github/workflows/build-macos-arm64.yml
|
|
with:
|
|
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
|
|
|
|
build-macos-intel:
|
|
name: Chain
|
|
uses: ./.github/workflows/build-macos-intel.yml
|
|
with:
|
|
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
|
|
|
|
build-docker:
|
|
name: Docker
|
|
uses: ./.github/workflows/build-docker.yml
|
|
with:
|
|
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
|
|
secrets: inherit
|
|
|
|
build-docs:
|
|
name: Docs
|
|
uses: ./.github/workflows/build-docs.yml
|