Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Release Signer Alongside Node" #5681

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 18 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,30 +50,21 @@ jobs:
with:
alias: "fmt-stacks"

## Check if the head branch of the PR is a release branch
##
## Runs when the following is true:
## - The workflow was triggered by a `workflow_dispatch` action
######################################################################################
## Check if the branch that this workflow is being run against is a release branch
check-release:
if: |
(
github.event_name == 'workflow_dispatch'
)
name: Check Release
needs:
- rustfmt
runs-on: ubuntu-latest
outputs:
node_tag: ${{ steps.check_release.outputs.node_tag }}
node_docker_tag: ${{ steps.check_release.outputs.node_docker_tag }}
signer_tag: ${{ steps.check_release.outputs.signer_tag }}
signer_docker_tag: ${{ steps.check_release.outputs.signer_docker_tag }}
is_node_release: ${{ steps.check_release.outputs.is_node_release }}
is_signer_release: ${{ steps.check_release.outputs.is_signer_release }}
tag: ${{ steps.check_release.outputs.tag }}
docker_tag: ${{ steps.check_release.outputs.docker_tag }}
is_release: ${{ steps.check_release.outputs.is_release }}
steps:
- name: Check Release
id: check_release
uses: stacks-network/actions/stacks-core/release/check-release@main
uses: stacks-network/actions/stacks-core/check-release@main
with:
tag: ${{ github.ref_name }}

Expand All @@ -84,20 +75,15 @@ jobs:
## - it is a release run
create-release:
if: |
needs.check-release.outputs.is_node_release == 'true' ||
needs.check-release.outputs.is_signer_release == 'true'
name: Create Release(s)
needs.check-release.outputs.is_release == 'true'
name: Create Release
needs:
- rustfmt
- check-release
uses: ./.github/workflows/github-release.yml
with:
node_tag: ${{ needs.check-release.outputs.node_tag }}
node_docker_tag: ${{ needs.check-release.outputs.node_docker_tag }}
signer_tag: ${{ needs.check-release.outputs.signer_tag }}
signer_docker_tag: ${{ needs.check-release.outputs.signer_docker_tag }}
is_node_release: ${{ needs.check-release.outputs.is_node_release }}
is_signer_release: ${{ needs.check-release.outputs.is_signer_release }}
tag: ${{ needs.check-release.outputs.tag }}
docker_tag: ${{ needs.check-release.outputs.docker_tag }}
secrets: inherit

## Build and push Debian image built from source
Expand All @@ -106,7 +92,7 @@ jobs:
## - it is not a release run
docker-image:
if: |
needs.check-release.outputs.is_signer_release != 'true'
needs.check-release.outputs.is_release != 'true'
name: Docker Image (Source)
uses: ./.github/workflows/image-build-source.yml
needs:
Expand All @@ -126,7 +112,7 @@ jobs:
## - commit to either (development, master) branch
create-cache:
if: |
needs.check-release.outputs.is_node_release == 'true' || (
needs.check-release.outputs.is_release == 'true' || (
github.event_name == 'workflow_dispatch' ||
github.event_name == 'pull_request' ||
github.event_name == 'merge_group' ||
Expand Down Expand Up @@ -158,7 +144,7 @@ jobs:
## - commit to either (development, next, master) branch
stacks-core-tests:
if: |
needs.check-release.outputs.is_signer_release == 'true' || (
needs.check-release.outputs.is_release == 'true' || (
github.event_name == 'workflow_dispatch' ||
github.event_name == 'pull_request' ||
github.event_name == 'merge_group' ||
Expand Down Expand Up @@ -212,7 +198,7 @@ jobs:

bitcoin-tests:
if: |
needs.check-release.outputs.is_node_release == 'true' || (
needs.check-release.outputs.is_release == 'true' || (
github.event_name == 'workflow_dispatch' ||
github.event_name == 'pull_request' ||
github.event_name == 'merge_group' ||
Expand All @@ -235,7 +221,7 @@ jobs:

p2p-tests:
if: |
needs.check-release.outputs.is_node_release == 'true' || (
needs.check-release.outputs.is_release == 'true' || (
github.event_name == 'workflow_dispatch' ||
github.event_name == 'pull_request' ||
github.event_name == 'merge_group' ||
Expand All @@ -260,7 +246,7 @@ jobs:
## Runs when:
## - it is a release run
atlas-tests:
if: needs.check-release.outputs.is_node_release == 'true'
if: needs.check-release.outputs.is_release == 'true'
name: Atlas Tests
needs:
- rustfmt
Expand All @@ -269,7 +255,7 @@ jobs:
uses: ./.github/workflows/atlas-tests.yml

epoch-tests:
if: needs.check-release.outputs.is_node_release == 'true'
if: needs.check-release.outputs.is_release == 'true'
name: Epoch Tests
needs:
- rustfmt
Expand All @@ -278,7 +264,7 @@ jobs:
uses: ./.github/workflows/epoch-tests.yml

slow-tests:
if: needs.check-release.outputs.is_node_release == 'true'
if: needs.check-release.outputs.is_release == 'true'
name: Slow Tests
needs:
- rustfmt
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/create-source-binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## Github workflow to create multiarch binaries from source

name: Create Binaries

on:
workflow_call:
inputs:
tag:
description: "Tag name of this release (x.y.z)"
required: true
type: string

## change the display name to the tag being built
run-name: ${{ inputs.tag }}

concurrency:
group: create-binary-${{ github.head_ref || github.ref || github.run_id}}
## Only cancel in progress if this is for a PR
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
## Runs when the following is true:
## - tag is provided
artifact:
if: |
inputs.tag != ''
name: Build Binaries
runs-on: ubuntu-latest
strategy:
## Run a maximum of 10 builds concurrently, using the matrix defined in inputs.arch
max-parallel: 10
matrix:
arch:
- linux-musl
- linux-glibc
- macos
- windows
cpu:
- arm64
- armv7
- x86-64 ## defaults to x86-64-v3 variant - intel haswell (2013) and newer
# - x86-64-v2 ## intel nehalem (2008) and newer
# - x86-64-v3 ## intel haswell (2013) and newer
# - x86-64-v4 ## intel skylake (2017) and newer
exclude:
- arch: windows # excludes windows-arm64
cpu: arm64
- arch: windows # excludes windows-armv7
cpu: armv7
- arch: macos # excludes macos-armv7
cpu: armv7

steps:
- name: Build Binary (${{ matrix.arch }}_${{ matrix.cpu }})
id: build_binary
uses: stacks-network/actions/stacks-core/create-source-binary@main
with:
arch: ${{ matrix.arch }}
cpu: ${{ matrix.cpu }}
tag: ${{ inputs.tag }}
150 changes: 54 additions & 96 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,12 @@ name: Github Release
on:
workflow_call:
inputs:
node_tag:
description: "Node Release Tag"
tag:
description: "Release Tag"
required: true
type: string
node_docker_tag:
description: "Node Docker Release Tag"
required: true
type: string
signer_tag:
description: "Signer Release Tag"
required: true
type: string
signer_docker_tag:
description: "Signer Docker Release Tag"
required: true
type: string
is_node_release:
description: "True if it is a node release"
required: true
type: string
is_signer_release:
description: "True if it is a signer release"
docker_tag:
description: "Docker Release Tag"
required: true
type: string
secrets:
Expand All @@ -38,107 +22,81 @@ concurrency:
## Always cancel duplicate jobs
cancel-in-progress: true

run-name: ${{ inputs.node_tag || inputs.signer_tag }}
run-name: ${{ inputs.tag }}

jobs:
## Build arch dependent binaries from source
##
## Runs when the following is true:
## - either node or signer tag is provided
## - tag is provided
build-binaries:
if: |
inputs.node_tag != '' ||
inputs.signer_tag != ''
inputs.tag != ''
name: Build Binaries
runs-on: ubuntu-latest
strategy:
## Run a maximum of 10 builds concurrently, using the matrix defined in inputs.arch
max-parallel: 10
matrix:
arch:
- linux-musl
- linux-glibc
- macos
- windows
cpu:
- arm64
- armv7
- x86-64 ## defaults to x86-64-v3 variant - intel haswell (2013) and newer
# - x86-64-v2 ## intel nehalem (2008) and newer
# - x86-64-v3 ## intel haswell (2013) and newer
# - x86-64-v4 ## intel skylake (2017) and newer
exclude:
- arch: windows # excludes windows-arm64
cpu: arm64
- arch: windows # excludes windows-armv7
cpu: armv7
- arch: macos # excludes macos-armv7
cpu: armv7
steps:
- name: Build Binary (${{ matrix.arch }}_${{ matrix.cpu }})
uses: stacks-network/actions/stacks-core/release/create-source-binary@main
with:
arch: ${{ matrix.arch }}
cpu: ${{ matrix.cpu }}
node_tag: ${{ inputs.node_tag }}
signer_tag: ${{ inputs.signer_tag }}
signer_docker_tag: ${{ inputs.signer_docker_tag }}
is_node_release: ${{ inputs.is_node_release }}
uses: ./.github/workflows/create-source-binary.yml
with:
tag: ${{ inputs.tag }}
secrets: inherit

## Runs when the following is true:
## - either node or signer tag is provided
## - tag is provided
## - workflow is building default branch (master)
create-release:
if: |
inputs.node_tag != '' ||
inputs.signer_tag != ''
inputs.tag != ''
name: Create Release
runs-on: ubuntu-latest
needs:
- build-binaries
steps:
## Creates releases
- name: Create Release
uses: stacks-network/actions/stacks-core/release/create-github-releases@main
## Downloads the artifacts built in `create-source-binary.yml`
- name: Download Artifacts
id: download_artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
node_tag: ${{ inputs.node_tag }}
node_docker_tag: ${{ inputs.node_docker_tag }}
signer_tag: ${{ inputs.signer_tag }}
signer_docker_tag: ${{ inputs.signer_docker_tag }}
is_node_release: ${{ inputs.is_node_release }}
is_signer_release: ${{ inputs.is_signer_release }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
pattern: ${{ inputs.tag }}-binary-build-*
path: release
merge-multiple: true

## Generate a checksums file to be added to the release page
- name: Generate Checksums
id: generate_checksum
uses: stacks-network/actions/generate-checksum@main
with:
artifact_download_pattern: "${{ inputs.tag }}-binary-build-*"

## Upload the release archives with the checksums file
- name: Upload Release
id: upload_release
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 #v2.0.5
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
name: Release ${{ inputs.tag || github.ref }}
tag_name: ${{ inputs.tag || github.ref }}
draft: false
prerelease: true
fail_on_unmatched_files: true
target_commitish: ${{ github.sha }}
generate_release_notes: true
files: |
release/*.zip
CHECKSUMS.txt

## Builds arch dependent Docker images from binaries
##
## Runs when the following is true:
## - either node or signer tag is provided
## - tag is provided
## - workflow is building default branch (master)
docker-image:
if: |
inputs.node_tag != '' ||
inputs.signer_tag != ''
inputs.tag != ''
name: Docker Image (Binary)
runs-on: ubuntu-latest
uses: ./.github/workflows/image-build-binary.yml
needs:
- build-binaries
- create-release
strategy:
fail-fast: false
## Build a maximum of 2 images concurrently based on matrix.dist
max-parallel: 2
matrix:
dist:
- alpine
- debian
steps:
- name: Create Docker Image
uses: stacks-network/actions/stacks-core/release/create-docker-images@main
with:
node_tag: ${{ inputs.node_tag }}
node_docker_tag: ${{ inputs.node_docker_tag }}
signer_tag: ${{ inputs.signer_tag }}
signer_docker_tag: ${{ inputs.signer_docker_tag }}
is_node_release: ${{ inputs.is_node_release }}
is_signer_release: ${{ inputs.is_signer_release }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
dist: ${{ matrix.dist }}
with:
tag: ${{ inputs.tag }}
docker_tag: ${{ inputs.docker_tag }}
secrets: inherit
Loading