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

Improve: Consolidate artifact build process for all environments & Add Workflow for preparing release branch #4256

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0bb682b
Prepare CMakeLists.txt for unified builds
gr0vity-dev Jun 19, 2023
50d7093
Prepare build.sh and node Dockerfile for unified builds
gr0vity-dev Jun 22, 2023
dd56958
Prepare WIndows for unified builds
gr0vity-dev Jun 19, 2023
f25d684
Convert TEST BETA and LIVE variable to NETWORK variable for easier wo…
gr0vity-dev Jun 19, 2023
b86b65b
Make docker builds and deploys more modular
gr0vity-dev Jun 19, 2023
02afcb6
Create unified workflow to build TEST BETA and LIVE artifacts
gr0vity-dev Jun 22, 2023
847427e
Remove hardcoded repo from build and deploy scripts
gr0vity-dev Jun 22, 2023
e958a40
Make workflow repository agnostic
gr0vity-dev Jun 22, 2023
bacd496
Fix CI_TAG usage
gr0vity-dev Jun 22, 2023
f6e5955
Use same login for ghcr and hub.docker
gr0vity-dev Jun 22, 2023
f4dd847
Fix docker login
gr0vity-dev Jun 29, 2023
ea96554
Fix nano network during build
gr0vity-dev Jun 29, 2023
3ef0689
Use config variables instead of secrets for non secret variables
gr0vity-dev Jun 29, 2023
79ad3dd
Fix: Make build process repository agnostic by specifying vars.DOCKER…
gr0vity-dev Jun 29, 2023
0381beb
Make tag generation branch agnostic
gr0vity-dev Jun 29, 2023
2c936ef
Remove CI_VERSION_PRE_RELEASE as it has been committed to CMakeLists.…
gr0vity-dev Jun 29, 2023
14bf659
Use the new prepare scripts
gr0vity-dev Jun 30, 2023
b390221
Make usage of nano-env:rhel explicit
gr0vity-dev Jul 1, 2023
06cf680
Fix typo in default BUILD_TYPE
gr0vity-dev Jul 1, 2023
a30b304
Make sure the existing_tags ending is numeric
gr0vity-dev Jul 1, 2023
f22ba6a
Remove --global for git config
gr0vity-dev Jul 1, 2023
77ca7cb
Handling release branches differently.
gr0vity-dev Jul 2, 2023
e4c150b
Prevent output file from being created when -o is not provided
gr0vity-dev Jul 3, 2023
2f6ee01
prevent script exit from grep returning a non-zero exit status if it …
gr0vity-dev Jul 3, 2023
aa49010
Add increment input to the workflow and force push if tag is unchanged
gr0vity-dev Jul 3, 2023
105fd39
Allow tag creation without file changes
gr0vity-dev Jul 3, 2023
2085d64
feat: implement workflow to prepare for a new major software release
gr0vity-dev Jun 29, 2023
b7e979a
Rename workflow to something more meaningful
gr0vity-dev Jul 11, 2023
2a4fed7
Remove increment input from workflow
gr0vity-dev Jul 11, 2023
e6d115e
Retry "brew update" up to 5 times with 15s interval
gr0vity-dev Jul 1, 2023
e61ea84
Apply suggestions from PR review (1/2)
gr0vity-dev Jul 16, 2023
148ec83
Apply suggestions from PR review (2/2)
gr0vity-dev Jul 16, 2023
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
217 changes: 217 additions & 0 deletions .github/workflows/artifacts_build_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
name: Build & Deploy
on:
schedule:
- cron: "0 0 * * 3,6"
workflow_dispatch:

env:
artifact: 1

jobs:
prepare_build:
runs-on: ubuntu-22.04
outputs:
CI_TAG: ${{ steps.tag_set.outputs.CI_TAG }}
TAG_CREATED: ${{ steps.tag_set.outputs.tag_created }}
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0
with:
ref: ${{ github.ref }}
- name: Set the tag and version
id: tag_set
run: |
output_var_file="variable_list.txt"
ci/actions/generate_next_git_tag.sh -c -o "${output_var_file}"
CI_TAG=$(grep 'build_tag' ${output_var_file} | cut -d= -f2)
echo "CI_TAG=${CI_TAG}" >> $GITHUB_OUTPUT
TAG_CREATED=$(grep 'tag_created' ${output_var_file} | cut -d= -f2)
echo "TAG_CREATED=${TAG_CREATED}" >> $GITHUB_OUTPUT
env:
GITHUB_ACTOR: ${{ github.actor }}


osx_job:
needs: prepare_build
if: ${{ needs.prepare_build.outputs.TAG_CREATED == 'true' }}
runs-on: macOS-12
timeout-minutes: 90
strategy:
matrix:
network: ["TEST", "BETA", "LIVE"]
steps:

- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0
with:
submodules: "recursive"
ref: ${{ needs.prepare_build.outputs.CI_TAG }}
repository: ${{ github.repository }}
- name: Prepare
run: ci/prepare/macos/prepare.sh
- name: Build Artifact
run: ci/build-deploy.sh "/tmp/qt/lib/cmake/Qt5";
pwojcikdev marked this conversation as resolved.
Show resolved Hide resolved
env:
NETWORK: ${{ matrix.network }}
CI_TAG: ${{ needs.prepare_build.outputs.CI_TAG }}
- name: Deploy Artifact
run: ci/actions/deploy.sh
env:
NETWORK: ${{ matrix.network }}
TAG: ${{ needs.prepare_build.outputs.CI_TAG }}
S3_BUCKET_NAME: ${{ vars.S3_BUCKET_NAME }}
S3_BUILD_DIRECTORY: ${{ vars.S3_BUILD_DIRECTORY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2


linux_job:
needs: prepare_build
if: ${{ needs.prepare_build.outputs.TAG_CREATED == 'true' }}
runs-on: ubuntu-22.04
timeout-minutes: 90
strategy:
matrix:
network: ["TEST", "BETA", "LIVE"]
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0
with:
submodules: "recursive"
ref: ${{ needs.prepare_build.outputs.CI_TAG }}
repository: ${{ github.repository }}
- name: Prepare
run: sudo -E ci/prepare/linux/prepare.sh
- name: Build Artifact
run: ci/build-deploy.sh "/usr/lib/x86_64-linux-gnu/cmake/Qt5"
env:
NETWORK: ${{ matrix.network }} \
CI_TAG: ${{ needs.prepare_build.outputs.CI_TAG }} \

- name: Deploy Artifact
run: ci/actions/deploy.sh
env:
NETWORK: ${{ matrix.network }}
TAG: ${{ needs.prepare_build.outputs.CI_TAG }}
S3_BUCKET_NAME: ${{ vars.S3_BUCKET_NAME }}
S3_BUILD_DIRECTORY: ${{ vars.S3_BUILD_DIRECTORY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2


linux_rpm_job:
needs: prepare_build
if: ${{ needs.prepare_build.outputs.TAG_CREATED == 'true' }}
runs-on: ubuntu-22.04
timeout-minutes: 90
strategy:
matrix:
network: ["BETA", "LIVE"] #No path to build TEST exists ci/build-rhel.sh
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0
with:
submodules: "recursive"
ref: "develop" #build-rhel.sh needs develop branch and then sets the tag
repository: ${{ github.repository }}
- name: Build local/nano-env:rhel
run: ci/actions/linux/install_deps.sh
env:
COMPILER: rhel
DOCKER_REGISTRY: local
- name: RockyLinux 8 Base
run: ci/build-docker-image.sh docker/ci/Dockerfile-rhel local/nano-env:rhel
- name: Build Artifact
run: |
mkdir -p ${GITHUB_WORKSPACE}/artifacts
docker run -v ${GITHUB_WORKSPACE}:/workspace -v ${GITHUB_WORKSPACE}/artifacts:/root/rpmbuild \
local/nano-env:rhel /bin/bash -c " \
NETWORK=${{ matrix.network }} \
TAG=${{ needs.prepare_build.outputs.CI_TAG }} \
REPO_TO_BUILD=${{ github.repository }} \
RPM_RELEASE=1 \
ci/build-rhel.sh"

- name: Deploy Artifacts
run: ci/actions/deploy.sh
env:
LINUX_RPM: 1
NETWORK: ${{ matrix.network }}
# TAG: ${{ needs.prepare_build.outputs.CI_TAG }} # (not used in the deploy script if LINUX_RPM==1 )
S3_BUCKET_NAME: ${{ vars.S3_BUCKET_NAME }}
S3_BUILD_DIRECTORY: ${{ vars.S3_BUILD_DIRECTORY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2


linux_docker_job:
needs: prepare_build
if: ${{ needs.prepare_build.outputs.TAG_CREATED == 'true' }}
runs-on: ubuntu-22.04
timeout-minutes: 90
strategy:
matrix:
network: ["TEST", "BETA", "LIVE"]
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0
with:
submodules: "recursive"
ref: ${{ needs.prepare_build.outputs.CI_TAG }}
repository: ${{ github.repository }}
- name: Build Docker
run: ci/actions/linux/docker-build.sh
env:
NETWORK: ${{ matrix.network }}
CI_TAG: ${{ needs.prepare_build.outputs.CI_TAG }}
DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }}
- name: Check if secrets.DOCKER_PASSWORD exists
run: echo "DOCKER_PASSWORD_EXISTS=${{ secrets.DOCKER_PASSWORD != '' }}" >> $GITHUB_ENV
pwojcikdev marked this conversation as resolved.
Show resolved Hide resolved
- name: Deploy Docker Hub
if: env.DOCKER_PASSWORD_EXISTS == 'true'
run: ci/actions/linux/docker-deploy.sh
env:
CI_TAG: ${{ needs.prepare_build.outputs.CI_TAG }}
NETWORK: ${{ matrix.network }}
DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }}
DOCKER_USER: ${{ vars.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Deploy Docker (ghcr.io)
run: ci/actions/linux/ghcr-deploy.sh
env:
CI_TAG: ${{ needs.prepare_build.outputs.CI_TAG }}
NETWORK: ${{ matrix.network }}
DOCKER_REGISTRY: ghcr.io
DOCKER_USER: ${{ github.repository_owner }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}


windows_job:
needs: prepare_build
if: ${{ needs.prepare_build.outputs.TAG_CREATED == 'true' }}
runs-on: windows-latest
timeout-minutes: 90
strategy:
matrix:
network: ["TEST", "BETA", "LIVE"]
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0
with:
submodules: "recursive"
ref: ${{ needs.prepare_build.outputs.CI_TAG }}
repository: ${{ github.repository }}
- name: Prepare
run: ci/prepare/windows/prepare.ps1
- name: Build Artifact
run: ci/actions/windows/build.ps1
env:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
- name: Deploy Artifact
run: ci/actions/windows/deploy.ps1
env:
NETWORK: ${{ matrix.network }}
TAG: ${{ needs.prepare_build.outputs.CI_TAG }}
S3_BUCKET_NAME: ${{ vars.S3_BUCKET_NAME }}
S3_BUILD_DIRECTORY: ${{ vars.S3_BUILD_DIRECTORY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2
Loading
Loading