1
0
Fork 0
forked from lthn/blockchain
blockchain/.github/workflows/_on-pr.yml

92 lines
2.7 KiB
YAML

name: PR
permissions:
contents: write
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
pull_request_review:
pull_request:
types:
- opened
- synchronize
- reopened
- closed
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
cleanup-release:
name: Cleanup Release
if: github.event.action == 'closed' && github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v4.2.2
- name: Get Version
id: get_version
run: echo "VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
- name: Delete Release and Tag
if: contains(steps.get_version.outputs.VERSION, '-alpha') || contains(steps.get_version.outputs.VERSION, '-beta')
uses: dev-drprasad/delete-older-releases@v0.3.4
with:
keep_latest: 0
delete_tags: true
delete_tag_pattern: ${{ steps.get_version.outputs.VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-linux-intel:
name: Linux
if: ${{!github.event.pull_request.draft}}
uses: ./.github/workflows/build-linux-intel.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-linux-arm:
name: Linux
if: ${{!github.event.pull_request.draft}}
uses: ./.github/workflows/build-linux-arm64.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-windows-intel:
name: Windows
if: ${{!github.event.pull_request.draft}}
uses: ./.github/workflows/build-windows-intel.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-macos-arm64:
name: MacOS
uses: ./.github/workflows/build-macos-arm64.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-macos-intel:
name: MacOS
if: ${{!github.event.pull_request.draft}}
uses: ./.github/workflows/build-macos-intel.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-docker:
name: Docker
if: ${{!github.event.pull_request.draft}}
uses: ./.github/workflows/build-docker.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-docs:
name: Docs
if: ${{!github.event.pull_request.draft}}
uses: ./.github/workflows/build-docs.yml