No description
Find a file
gr0vity-dev 47568010c0
Improve: Consolidate artifact build process for all environments & Add Workflow for preparing release branch (#4256)
* Prepare CMakeLists.txt for unified builds

- Remove CI_BUILD Cmake variable.
- Convert CI_TAG from ENV variable to CMake variable
- CI_VERSION_PRE_RELEASE can be set in non CI builds

* Prepare build.sh and node Dockerfile for unified builds

- add CI_TAG and CI_VERSION_PRE_RELEASE to build.sh
- add useful ARG with default values to Dockerfile so they can be passed to the build.sh script

* Prepare WIndows for unified builds

- remove CI_BUILD
- convert DCI_TAG from ENV to CMake variable

* Convert TEST BETA and LIVE variable to NETWORK variable for easier workflow matrix usage

* Make docker builds and deploys more modular

- Remove dependency on the workflow name
- COnvert $GITHUB_WORKFLOW to $NETWORK
- Create smaller functions with limited scope
- Create similar deploy functions for docker and github container registries (hub.docker and ghcr)

* Create unified workflow to build TEST BETA and LIVE artifacts

- Remove old workflows
- Create 1 workflow for all environments (Network Matrix)
- Keep current build logic (build scripts still differ per OS)

* Remove hardcoded repo from build and deploy scripts

- skip hub.docker deploys if DOCKER_PASSWORD is not provided
- Create DOCKER_HUB variable which defaults to nanocurrency (backwards compatible)
- Create DOCKER_USER variable which defaults to nanoreleaseteam (backwards compatible)

- create S3_BUCKET_NAME variable that defaults to repo.nano.org if not provided (backwards compatible)
- only use S3_BUILD_DIRECTORY if provided

* Make workflow repository agnostic

Convert nanocurrency/nano-env image to self built ghcr.io/${{ github.repository }} image

* Fix CI_TAG usage

- convert ref to CI_TAG
- use CI_TAG in aws deploys

* Use same login for ghcr and hub.docker

* Fix docker login

- add possibility to specify registry
- use ghcr.io instead of variable for ghcr_image_name

* Fix nano network during build

* Use config variables instead of secrets for non secret variables

- vars.S3_BUCKET_NAME
- vars.S3_BUILD_DIRECTORY
- vars.DOCKER_REGISTRY
- vars.DOCKER_USER

* Fix: Make build process repository agnostic by specifying vars.DOCKER_REGISTRY

* Make tag generation branch agnostic

The goal is to simplify tag generation process and commit the version_pre_release into CMakeLists.txt for each tag.
If a user checks out a specific tag and builds it, the version_pre_release is set correctly.

- remove workflow_dispatch inputs. It operates on the selected branch.
- The cronjob is executed on develop branch only.
- replace ci/actions/dev-build-tag-gen.sh with ci/actions/generate_next_git_tag.sh
- generate_next_git_tag.sh is branch agnostic and operates on  ${{ github.ref }}
- generate_next_git_tag.sh succeeds even if no new tag is generated
- the workflow only executes the build jobs if a new tag was created (if: ${{ needs.prepare_build.outputs.TAG_CREATED == 'true' }})
- generate_next_git_tag.sh uses V${current_version_major}.${current_version_minor}${branch_name} for tags.
- for "develop" branch_name is converted to DB --> (e.g V26.0DB1)
- generate_next_git_tag.sh uses a -c flag that is responsible to update CMakeLists.txt with correct version_pre_release, create and push the tag to origin.

* Remove CI_VERSION_PRE_RELEASE as it has been committed to CMakeLists.txt in the tag used to build the node

* Use the new prepare scripts

- use the new prepare scripts (Linux, MacOS & Windows)
- remove the need the dependency on nano-env:gcc

* Make usage of nano-env:rhel explicit

- Build the nano-env docker image in the current workflow
- Use the locally built image.

* Fix typo in default BUILD_TYPE

- Remove duplicate BUILD_TYPE
- move SANITIZER to ci/build-node.sh ARGs

* Make sure the existing_tags ending is numeric

- fixes a bug when we have 2 similar branches with tags (e.g. some-branch and some-branch-2)

* Remove --global for git config

Prevent modification of global git settings on a developer machine

* Handling release branches differently.

- refactored script by making it more modular
- script expects releases to be made from a branch called `releases/v{Major}`
- add -i flag to indicate wether or not to increment the generated tag
- -i increments version_minor for release branches: tag --> V{Major}.{Minor + increment}
- -i increments version_pre_release for all other non-release branches: tag --> V{Major}.{Minor}{branch_name}{pre_release + increment}
- -o outputs either `version_pre_release` or `version_minor` depending on the branch

Prevent incrementing if no tag exists yet

- make sure V{Major}.0 is created even if the user forgets to set increment to 0

Make tag_created=true explicit

* Prevent output file from being created when -o is not provided

- by redefining local output=$1 it is set to 0 instead of "" and a file called 0 was created

* prevent script exit from grep returning a non-zero exit status if it doesn't find anything

* Add increment input to the workflow and force push if tag is unchanged

- increment is 1 by default
- if increment is 0, an existing tag will be updated (origin push -f).

fixup! Add increment input to the workflow

* Allow tag creation without file changes

- the first tag of a releases/ branch creates no changes
- a tag run with increment=0 creates no changes
in both cases we want to create the tag (again)

* feat: implement workflow to prepare for a new major software release

- Checks out the repository based on github.ref.
- Extracts and sets current major and minor versions from CMakeLists.txt of github.ref.
- Fetches the default branch name and sets it as an output.
- Checks for existence of a corresponding release branch. If present, the workflow aborts, if not, it continues and sets the new release branch name.
- Increments the major version in CMakeLists.txt on the default branch, commits this change, and pushes it back.
- Checks out a new release branch, sets the pre-release version to 0 in CMakeLists.txt, commits this change, and pushes the new branch to the repository.

fix: Configure git and fix output variables

Change the order of steps to make the flow more natural

Fix curl DEFAULT_BRANCH

fix

fix

* Rename workflow to something more meaningful

* Remove increment input from workflow

- Autodetect if we need to increment the version or not on the release branch
Expected behaviour :
- Running the workflow multiple times without a new commit will rebuild and republish the same artifacts
- Running the workflow after a new commit was made to the releases branch will increment version_minor by 1
  - the version_minor is updated in CMakeLists.txt and committed to the release branch
  - a new tag is created and pushed with the incremented version_minor
- Make logic for both release and other branches more obvious

 --> TODO?: instead of force pushing, we could remove -f option if branch or tag already exist

* Retry "brew update" up to 5 times with 15s interval

* Apply suggestions from PR review (1/2)

* Apply suggestions from PR review (2/2)

Convert if/else into case..in

---------

Co-authored-by: gr0vity-dev <gr0vity-dev@users.noreply.github.com>
2023-07-20 18:37:15 +01:00
.github Improve: Consolidate artifact build process for all environments & Add Workflow for preparing release branch (#4256) 2023-07-20 18:37:15 +01:00
api/flatbuffers Add Flatbuffers schema evolution rules to IDL (#2644) 2020-04-21 12:11:01 -05:00
ci Improve: Consolidate artifact build process for all environments & Add Workflow for preparing release branch (#4256) 2023-07-20 18:37:15 +01:00
CL Fix typo in comment 2017-12-28 01:24:23 -06:00
cmake Weekly Coverage Runs to coveralls.io (#3055) 2021-07-21 05:30:24 -07:00
coverage Move all submodules into one directory 2023-01-23 13:52:35 +00:00
crypto Move all submodules into one directory 2023-01-23 13:52:35 +00:00
debian-control cmake format pass (#3053) 2020-11-19 08:46:48 -08:00
doc/diagram Create directory doc/diagram (#3968) 2022-10-05 15:00:44 +01:00
docker Improve: Consolidate artifact build process for all environments & Add Workflow for preparing release branch (#4256) 2023-07-20 18:37:15 +01:00
doxygen Updates the doxigen.config (#3726) 2022-02-09 14:54:56 -03:00
etc GPG public key for Dimitrios Siganos 2021-04-21 16:10:01 +01:00
images Update images for README and QT wallet to be new symbol (#3586) 2021-12-21 09:50:27 -06:00
nano Extract rollback_competitor function and simplify proces_batch. (#4252) 2023-06-25 16:38:20 +01:00
submodules Enable running core test suite in parallel (#4246) 2023-06-13 17:27:58 +02:00
systest add logging in systest/coi_wallet_create.sh (#4016) 2022-12-02 14:44:21 +00:00
util Update to use RockyLinux 8 as RHEL 8 compatible base 2023-05-29 19:38:16 -03:00
valgrind Use the MDB_NOMEMINIT flag with the ledger db environment (#2077) 2019-06-25 12:11:21 +01:00
.clang-format Formatting rules update -- indentation rules improvements (#3506) 2021-10-19 14:23:07 +03:00
.gitignore Cleanup qt_system remnants (#3189) (#3488) 2021-10-12 13:14:41 +01:00
.gitlab-ci.yml adding support for rpm building (#1175) 2019-02-15 11:23:58 -05:00
.gitmodules Enable running core test suite in parallel (#4246) 2023-06-13 17:27:58 +02:00
asan_blacklist Fixing an asan issue. 2014-11-04 22:01:22 -06:00
boost_checkout_lite.sh Adding boost as a submodule rather than requiring it to be provided externally. 2023-01-13 16:20:34 +00:00
CMakeLists.txt Improve: Consolidate artifact build process for all environments & Add Workflow for preparing release branch (#4256) 2023-07-20 18:37:15 +01:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md (#3834) 2023-01-12 13:20:00 +00:00
CONTRIBUTING.md Add basic contributing file with links to docs for details (#3650) 2022-01-05 10:03:57 -06:00
doxygen.config Updates the doxigen.config (#3726) 2022-02-09 14:54:56 -03:00
Info.plist.in add test network to build artifacts for non DB tags (#3000) 2020-10-20 10:04:56 -07:00
LICENSE Update LICENSE (#3669) 2022-01-14 15:38:03 -03:00
logo.png Update images for README and QT wallet to be new symbol (#3586) 2021-12-21 09:50:27 -06:00
Nano.icns Update images for README and QT wallet to be new symbol (#3586) 2021-12-21 09:50:27 -06:00
Nano.ico Update images for README and QT wallet to be new symbol (#3586) 2021-12-21 09:50:27 -06:00
Nano.rc Rename internal project bits from RaiBlocks to Nano (#1504) 2018-12-28 14:58:50 -06:00
nanocurrency-beta.spec.in Fix nano_node binary name for beta RPM service installation 2023-05-30 17:48:15 -03:00
nanocurrency.spec.in Update to use RockyLinux 8 as RHEL 8 compatible base 2023-05-29 19:38:16 -03:00
qt.conf Found the correct magic recipe to get packaging working. 2014-11-09 18:51:16 -06:00
README.md Update README.md 2021-07-26 17:28:46 +10:00
rep_weights_beta.bin Update rep weights for V25. (#4229) 2023-05-10 22:06:16 +01:00
rep_weights_live.bin Update rep weights for V25. (#4229) 2023-05-10 22:06:16 +01:00
resources.qrc fixed the inclusion of the logo file into the binary using QT resources 2017-04-20 13:19:26 -05:00
SECURITY.md Remove wezrule from security policy (#3396) 2021-07-26 11:09:08 -05:00
tsan_clang_blacklist TSAN suppressions file (#1941) 2019-04-30 16:55:32 +01:00
tsan_suppressions Add suppressions for Rijndael::Base::FillEncTable and Rijndael::Base::FillDecTable. There is a race condition when initializing these tables but since their contents is static, the fields will always have the correct, constant values. 2021-11-22 11:58:30 +00:00
valgrind.supp Valgrind fixes & suppressions (#1814) 2019-03-15 13:55:45 +03:00

Logo

Live Artifacts Beta Artifacts GitHub release (latest by date) GitHub tag (latest by date) Coverage Status Tests RelWithDebug Tests Discord


What is Nano?

Nano is a digital payment protocol designed to be accessible and lightweight, with a focus on removing inefficiencies present in other cryptocurrencies. With ultrafast transactions and zero fees on a secure, green and decentralized network, this makes Nano ideal for everyday transactions.


Guides & Documentation

Other documentation details can be found at https://docs.nano.org.



Want to Contribute?

Please see the contributors guide.


Contact us

We want to hear about any trouble, success, delight, or pain you experience when using Nano. Let us know by filing an issue, joining us on Reddit, or joining us on Discord.