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

Release Signer Alongside Node #57

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8c7e168
feat: change check-release job to output both node and signer docker …
BowTiedDevOps Nov 6, 2024
5bf2fd4
feat: add composite action to extract the signer from existing cache
BowTiedDevOps Nov 6, 2024
c453a6c
feat: change 'CACHE_NAME' env setting
BowTiedDevOps Nov 7, 2024
2a10532
feat: add test prints
BowTiedDevOps Nov 7, 2024
6b867cd
feat: update archive name
BowTiedDevOps Nov 7, 2024
84436f5
feat: move github release flow out of `stacks-core` repo
BowTiedDevOps Nov 13, 2024
f508851
fix: change input name
BowTiedDevOps Nov 13, 2024
8728bcb
fix: replace tag input with signer_tag
BowTiedDevOps Nov 13, 2024
ba1877c
fix: parse secrets through inputs
BowTiedDevOps Nov 13, 2024
a6362dd
fix: add secrets inputs to caller jobs
BowTiedDevOps Nov 13, 2024
92f4e54
feat: add/modify documentations to reflect modified release workflow
BowTiedDevOps Nov 13, 2024
569a62f
fix: change 'secrets' to 'inputs'
BowTiedDevOps Nov 13, 2024
8a2ecfb
fix: add 'shell: bash' when creating docker images
BowTiedDevOps Nov 13, 2024
069e6e3
fix: add missing secret inputs
BowTiedDevOps Nov 13, 2024
fd39799
feat: remove `signer-` from signer version tag
BowTiedDevOps Nov 18, 2024
05546e8
fix: change input name
BowTiedDevOps Nov 18, 2024
4085012
feat: make linker env variables static
BowTiedDevOps Nov 18, 2024
7dff48f
fix: export linker env vars to be accessible by both build steps
BowTiedDevOps Nov 19, 2024
1949667
fix: change artifact path when creating release
BowTiedDevOps Nov 19, 2024
49ebdf8
feat: use both normal and docker tags on create-release job
BowTiedDevOps Nov 19, 2024
6b17d25
feat: publish latest docker tag on non-rc builds
BowTiedDevOps Nov 19, 2024
1d5cc2f
fix: set env based on rc or non-rc release
BowTiedDevOps Nov 19, 2024
bb09a3e
fix: change how docker rc env is checked
BowTiedDevOps Nov 19, 2024
9de7cbe
fix typo in docker tags
BowTiedDevOps Nov 19, 2024
e07c7fb
feat: add linux distribution input to docker image jobs
BowTiedDevOps Nov 19, 2024
ba2e695
fix: negate docker tag rc condition
BowTiedDevOps Nov 21, 2024
955fddf
fix: check for signer release by signer tag instead of signer docker tag
BowTiedDevOps Nov 21, 2024
45bb74d
feat: update composite branch used to main
BowTiedDevOps Nov 22, 2024
923e01b
fix: align text left in readmes, exit check-release early
BowTiedDevOps Dec 11, 2024
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
3 changes: 1 addition & 2 deletions stacks-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ Folder of composite actions for the [stacks blockchain](https://github.com/stack
- [testenv](./testenv) - Configures a workflow with a testing environment
- [run-tests](./run-tests) - Run tests with [nextest](https://nexte.st)
- [mutation-testing](./mutation-testing) - Run mutation testing
- [create-source-binary](./create-source-binary) - Create the stacks-core binaries for release
- [check-release](./check-release) - Check whether there is a node/signer release or not
- [release](./release) - Actions used in Stacks Core release process
34 changes: 0 additions & 34 deletions stacks-core/check-release/README.md

This file was deleted.

61 changes: 0 additions & 61 deletions stacks-core/check-release/action.yml

This file was deleted.

32 changes: 0 additions & 32 deletions stacks-core/create-source-binary/README.md

This file was deleted.

11 changes: 11 additions & 0 deletions stacks-core/release/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Stacks Core release github actions

Folder of composite actions for the release process of [stacks blockchain](https://github.com/stacks-network/stacks-core)

- [check-release](./check-release) - Check whether there is a node/signer release or not
- [create-docker-images](./create-docker-images) - Create the docker images for specific `stacks-core` binaries
- [docker-image](./docker-image) - Create and upload a docker image
- [create-github-releases](./create-github-releases) - Create the github releases for specific `stacks-core` binaries
- [create-release](./create-release) - Create and upload a github release
- [create-source-binary](./create-source-binary) - Create the stacks-core binaries for release
- [extract-signer-binary](./extract-signer-binary) - Extract the signer binary from existing `stacks-core` binaries archive
37 changes: 37 additions & 0 deletions stacks-core/release/check-release/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Check Release action

Checks whether the tag parsed as argument matches a stacks-node release, a stacks-signer release or no release at all, through regex patterns.

## Documentation

### Inputs
| Input | Description | Required | Default |
| ----- | ------------------------------------------- | -------- | ------- |
| `tag` | The branch name against which the step runs | true | |

### Outputs
| Output | Description |
| ------------------- | --------------------------------------------------------------------- |
| `node_tag` | The node release tag, if there is one (empty otherwise). |
| `node_docker_tag` | The node release tag for docker, if there is one (empty otherwise). |
| `signer_tag` | The signer release tag, if there is one (empty otherwise). |
| `signer_docker_tag` | The signer release tag for docker, if there is one (empty otherwise). |
| `is_node_release` | True if the branch is a node release one, false otherwise. |
| `is_signer_release` | True if the branch is a signer release one, false otherwise. |

## Usage

```yaml
name: Action
on: pull-request
jobs:
check-packages-and-shards:
name: Check Release
runs-on: ubuntu-latest
steps:
- name: Check Release
id: check_release
uses: stacks-network/actions/stacks-core/release/check-release@main
with:
tag: "release/2.5.0.0.5-rc6"
```
80 changes: 80 additions & 0 deletions stacks-core/release/check-release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
## Composite action to check if the branch is a release tag or not
name: Check Release

inputs:
tag:
description: "The branch name against which the step runs"
required: true

outputs:
node_tag:
description: "The node release tag, if there is one (empty otherwise)."
value: ${{ steps.check_release.outputs.node_tag }}
node_docker_tag:
description: "The node release tag for docker, if there is one (empty otherwise)."
value: ${{ steps.check_release.outputs.node_docker_tag }}
signer_tag:
description: "The signer release tag, if there is one (empty otherwise)."
value: ${{ steps.check_release.outputs.signer_tag }}
signer_docker_tag:
description: "The signer release tag for docker, if there is one (empty otherwise)."
value: ${{ steps.check_release.outputs.signer_docker_tag }}
is_node_release:
description: "True if the branch is a release one, false otherwise."
value: ${{ steps.check_release.outputs.is_node_release }}
is_signer_release:
description: "True if the branch is a release one, false otherwise."
value: ${{ steps.check_release.outputs.is_signer_release }}

runs:
using: "composite"
steps:
- name: Set Release Outputs
id: check_release
shell: bash
run: |
branch_name=${{ inputs.tag }}

stacks_core_version_regex="([0-9].[0-9].[0-9].[0-9].[0-9]+(-rc[0-9]+)?)" # matches x.x.x.x.x || x.x.x.x.x-rcx
signer_version_regex="([0-9].[0-9].[0-9].[0-9].[0-9].[0-9]+(-rc[0-9]+)?)" # matches x.x.x.x.x.x || x.x.x.x.x.x-rcx

stacks_core_regex_base="release/"
signer_regex_base="release/signer-"

stacks_core_regex="${stacks_core_regex_base}${stacks_core_version_regex}"
signer_regex="${signer_regex_base}${signer_version_regex}"

node_tag=""
node_docker_tag=""
signer_tag=""
signer_docker_tag=""
is_node_release=false
is_signer_release=false

case ${branch_name} in
release/signer-[0-9]*)
signer_tag=$(echo "$branch_name" | sed "s|^${stacks_core_regex_base}||g")
signer_docker_tag=$(echo "$branch_name" | sed "s|^${signer_regex_base}||g")
is_signer_release=true
;;
release/[0-9]*)
node_tag=$(echo "$branch_name" | sed "s|^${stacks_core_regex_base}||g")
node_docker_tag=${node_tag}
signer_tag="signer-$(echo ${node_tag} | sed 's/\(-[^-]*\)*$/.0\1/')"
signer_docker_tag=$(echo ${node_tag} | sed 's/\(-[^-]*\)*$/.0\1/')
is_node_release=true
is_signer_release=true
;;
*)
exit 1
;;
esac

echo "node_tag=$node_tag" >> "$GITHUB_OUTPUT"
echo "node_docker_tag=$node_docker_tag" >> "$GITHUB_OUTPUT"
echo "signer_tag=$signer_tag" >> "$GITHUB_OUTPUT"
echo "signer_docker_tag=$signer_docker_tag" >> "$GITHUB_OUTPUT"
echo "is_node_release=$is_node_release" >> "$GITHUB_OUTPUT"
echo "is_signer_release=$is_signer_release" >> "$GITHUB_OUTPUT"

exit 0
43 changes: 43 additions & 0 deletions stacks-core/release/create-docker-images/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Create Docker Images action

Creates docker images for the node and the signer.

## Documentation

### Inputs

| Input | Description | Required | Default |
| -------------------- | ------------------------------------- | -------- | ------- |
| `node_tag` | Node Release Tag | `true` | null |
| `node_docker_tag` | Node Docker Release Tag | `true` | null |
| `signer_tag` | Signer Release Tag | `true` | null |
| `signer_docker_tag` | Signer Docker Release Tag | `true` | null |
| `is_node_release` | True if it is a node release | `true` | null |
| `is_signer_release` | True if it is a signer release | `true` | null |
| `DOCKERHUB_USERNAME` | Docker username for publishing images | `true` | null |
| `DOCKERHUB_PASSWORD` | Docker password for publishing images | `true` | null |
| `dist` | Linux Distribution to build for | `true` | null |

## Usage

```yaml
name: Action
on: push
jobs:
build:
name: Job
runs-on: ubuntu-latest
steps:
- name: Create Docker Images
id: create_docker_images
uses: stacks-network/actions/stacks-core/release/create-docker-images@main
with:
node_tag: 3.0.0.0.1-rc1
node_docker_tag: 3.0.0.0.1-rc1
signer_tag: signer-3.0.0.0.1.0-rc1
signer_docker_tag: 3.0.0.0.1.0-rc1
is_node_release: 'true'
is_signer_release: 'true'
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
```
64 changes: 64 additions & 0 deletions stacks-core/release/create-docker-images/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
## Github workflow to create and upload github releases
name: Create Releases
description: "Create GitHub Releases"
branding:
icon: "archive"
color: "gray-dark"

inputs:
node_tag:
description: "Node Release Tag"
required: true
node_docker_tag:
description: "Node Docker Release Tag"
required: true
signer_tag:
description: "Signer Release Tag"
required: true
signer_docker_tag:
description: "Signer Docker Release Tag"
required: true
is_node_release:
description: "True if it is a node release"
required: true
is_signer_release:
description: "True if it is a signer release"
required: true
DOCKERHUB_USERNAME:
description: "Docker username for publishing images"
required: true
DOCKERHUB_PASSWORD:
description: "Docker password for publishing images"
required: true
dist:
description: "Linux Distribution to build for"
required: true

runs:
using: "composite"
steps:
## Creates the node docker image
- name: Create Node Docker Image
if: |
inputs.is_node_release == 'true'
id: create_node_release
uses: stacks-network/actions/stacks-core/release/docker-image@main
with:
tag: ${{ inputs.node_tag }}
docker_tag: ${{ inputs.node_docker_tag }}
DOCKERHUB_USERNAME: ${{ inputs.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ inputs.DOCKERHUB_PASSWORD }}
dist: ${{ inputs.dist }}

## Creates the signer docker image
- name: Create Signer Docker Image
if: |
inputs.is_signer_release == 'true'
id: create_signer_release
uses: stacks-network/actions/stacks-core/release/docker-image@main
with:
tag: ${{ inputs.signer_tag }}
docker_tag: ${{ inputs.signer_docker_tag }}
DOCKERHUB_USERNAME: ${{ inputs.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ inputs.DOCKERHUB_PASSWORD }}
dist: ${{ inputs.dist }}
Loading