Skip to content

Commit

Permalink
Debug pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
askolesov committed Dec 7, 2021
1 parent f026855 commit c7419af
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 131 deletions.
40 changes: 17 additions & 23 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,11 @@ jobs:
- name: Restore binary permissions
run: sudo chmod +x /home/runner/go/bin/cheqd-noded

- name: Make archive
- name: Make intermediate archive
working-directory: ./build_tools
run: |
./build_tar.sh ${{ env.PACKAGE_NAME }} ${{ env.VERSION }}
- name: Store tar artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.PACKAGE_NAME }}_${{ env.VERSION }}.tar.gz
path: build_tools/output/${{ env.PACKAGE_NAME }}_${{ env.VERSION }}.tar.gz

- name: Install fpm
run: |
sudo apt-get install ruby ruby-dev rubygems build-essential
Expand Down Expand Up @@ -124,13 +118,13 @@ jobs:
run: docker build -f docker/cheqd_node/Dockerfile --no-cache -t cheqd-node --build-arg UID=$(id -u) --build-arg GID=$(id -g) . # TODO: Get rid of UID and GID

- name: Save
run: docker save -o cheqd-node.tar cheqd-node
run: docker save -o cheqd-node-image.tar cheqd-node

- name: Store artifact
uses: actions/upload-artifact@v2
with:
name: cheqd-node.tar
path: cheqd-node.tar
name: cheqd-node-image.tar
path: cheqd-node-image.tar

build-testnet-image:
name: Build cheqd-testnet image
Expand All @@ -143,22 +137,22 @@ jobs:
- name: Download node image
uses: actions/download-artifact@v2
with:
name: cheqd-node.tar
name: cheqd-node-image.tar

- name: Load node image
run: docker load -i cheqd-node.tar
run: docker load -i cheqd-node-image.tar

- name: Build
run: docker build -f docker/single_image_testnet/Dockerfile --no-cache -t cheqd-testnet .

- name: Save
run: docker save -o cheqd-testnet.tar cheqd-testnet
run: docker save -o cheqd-testnet-image.tar cheqd-testnet

- name: Store artifact
uses: actions/upload-artifact@v2
with:
name: cheqd-testnet.tar
path: cheqd-testnet.tar
name: cheqd-testnet-image.tar
path: cheqd-testnet-image.tar

test-new-node-setup-from-deb:
name: Test new node setup from deb
Expand All @@ -176,10 +170,10 @@ jobs:
- name: Download node image
uses: actions/download-artifact@v2
with:
name: cheqd-node.tar
name: cheqd-node-image.tar

- name: Load node image
run: docker load -i cheqd-node.tar
run: docker load -i cheqd-node-image.tar

- name: Check out
uses: actions/checkout@v2
Expand Down Expand Up @@ -233,10 +227,10 @@ jobs:
- name: Download node image
uses: actions/download-artifact@v2
with:
name: cheqd-node.tar
name: cheqd-node-image.tar

- name: Load node image
run: docker load -i cheqd-node.tar
run: docker load -i cheqd-node-image.tar

- uses: actions/checkout@v2

Expand Down Expand Up @@ -271,10 +265,10 @@ jobs:
- name: Download testnet image
uses: actions/download-artifact@v2
with:
name: cheqd-testnet.tar
name: cheqd-testnet-image.tar

- name: Load testnet image
run: docker load -i cheqd-testnet.tar
run: docker load -i cheqd-testnet-image.tar

- name: Run test net container
run: |
Expand Down Expand Up @@ -313,10 +307,10 @@ jobs:
- name: Download testnet image
uses: actions/download-artifact@v2
with:
name: cheqd-testnet.tar
name: cheqd-testnet-image.tar

- name: Load testnet image
run: docker load -i cheqd-testnet.tar
run: docker load -i cheqd-testnet-image.tar

- name: Run test net container
run: |
Expand Down
195 changes: 87 additions & 108 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
GITHUB_REPOSITORY_NAME: ${{ steps.cache.outputs.GITHUB_REPOSITORY_NAME }}
TAG: ${{ steps.cache.outputs.TAG }}
VERSION: ${{ steps.cache.outputs.VERSION }}
steps:
- name: Git checkout
Expand All @@ -24,6 +25,8 @@ jobs:
# Version is tag without `v` prefix. Reuired by deb package.
TAG=${GITHUB_REF/refs\/tags\//}
echo "::set-output name=TAG::$TAG"
VERSION="${TAG:1}" # Remove first character
echo "::set-output name=VERSION::$VERSION"
Expand Down Expand Up @@ -58,7 +61,7 @@ jobs:
build-deb-package:
name: Build deb package
runs-on: ubuntu-20.04
needs: [build-binary, setup-workflow]
needs: [ build-binary, setup-workflow ]
env:
PACKAGE_NAME: "cheqd-node"
VERSION: ${{ needs.setup-workflow.outputs.VERSION }}
Expand All @@ -74,17 +77,11 @@ jobs:
- name: Restore binary permissions
run: sudo chmod +x /home/runner/go/bin/cheqd-noded

- name: Make archive
- name: Make intermediate archive
working-directory: ./build_tools
run: |
./build_tar.sh ${{ env.PACKAGE_NAME }} ${{ env.VERSION }}
- name: Store tar artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.PACKAGE_NAME }}_${{ env.VERSION }}.tar.gz
path: build_tools/output/${{ env.PACKAGE_NAME }}_${{ env.VERSION }}.tar.gz

- name: Install fpm
run: |
sudo apt-get install ruby ruby-dev rubygems build-essential
Expand Down Expand Up @@ -113,13 +110,13 @@ jobs:
run: docker build -f docker/cheqd_node/Dockerfile --no-cache -t cheqd-node --build-arg UID=$(id -u) --build-arg GID=$(id -g) . # TODO: Get rid of UID and GID

- name: Save
run: docker save -o cheqd-node.tar cheqd-node
run: docker save -o cheqd-node-image.tar cheqd-node

- name: Store artifact
uses: actions/upload-artifact@v2
with:
name: cheqd-node.tar
path: cheqd-node.tar
name: cheqd-node-image.tar
path: cheqd-node-image.tar

build-testnet-image:
name: Build cheqd-testnet image
Expand All @@ -132,111 +129,93 @@ jobs:
- name: Download node image
uses: actions/download-artifact@v2
with:
name: cheqd-node.tar
name: cheqd-node-image.tar

- name: Load node image
run: docker load -i cheqd-node.tar
run: docker load -i cheqd-node-image.tar

- name: Build
run: docker build -f docker/single_image_testnet/Dockerfile --no-cache -t cheqd-testnet .

- name: Save
run: docker save -o cheqd-testnet.tar cheqd-testnet
run: docker save -o cheqd-testnet-image.tar cheqd-testnet

- name: Store artifact
uses: actions/upload-artifact@v2
with:
name: cheqd-testnet.tar
path: cheqd-testnet.tar

# publish-images:
# name: "Publish docker images"
# # Reference to workflow-setup job is required to access its various outputs.
# needs: setup-workflow
# runs-on: ubuntu-latest
# env:
# GITHUB_REPOSITORY_NAME: ${{ needs.setup-workflow.outputs.GITHUB_REPOSITORY_NAME }}
# VERSION: ${{ needs.setup-workflow.outputs.VERSION }}
# TESTNET_IMAGE_NAME: "cheqd-testnet"
# STARPORT_RELEASE_PARAMS: "--release"
# steps:
# - name: Git checkout
# uses: actions/checkout@v2
#
# - name: Login to docker
# run: |
# echo ${{ secrets.GH_PAT }} | docker login ghcr.io --username ${{ secrets.GH_USER }} --password-stdin
#
# - name: Build node image
# run: |
# docker build -f docker/cheqd_node/Dockerfile.release \
# --no-cache \
# --build-arg STARPORT_RELEASE_PARAMS=${{ env.STARPORT_RELEASE_PARAMS }} \
# -t cheqd-node .
# - name: Build testnet image
# run: |
# docker build -f docker/single_image_testnet/Dockerfile --no-cache -t cheqd-testnet .
# - name: Push node image
# run: |
# docker tag cheqd-node ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}:${{ env.VERSION }}
# docker tag cheqd-node ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}:latest
# docker push ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}:${{ env.VERSION }}
# docker push ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}:latest
# - name: Push testnet image
# run: |
# docker tag cheqd-testnet ghcr.io/${{ github.repository_owner }}/${{ env.TESTNET_IMAGE_NAME }}:${{ env.VERSION }}
# docker tag cheqd-testnet ghcr.io/${{ github.repository_owner }}/${{ env.TESTNET_IMAGE_NAME }}:latest
# docker push ghcr.io/${{ github.repository_owner }}/${{ env.TESTNET_IMAGE_NAME }}:${{ env.VERSION }}
# docker push ghcr.io/${{ github.repository_owner }}/${{ env.TESTNET_IMAGE_NAME }}:latest

# publish-release:
# name: "Publish release"
# needs: [setup-workflow, publish-images]
# runs-on: "ubuntu-latest"
# env:
# GITHUB_REPOSITORY_NAME: ${{ needs.setup-workflow.outputs.GITHUB_REPOSITORY_NAME }}
# VERSION: ${{ needs.setup-workflow.outputs.VERSION }}
# OUTPUT_DIR: "output"
# PACKAGE_NAME: "cheqd-node"
# RELEASE_TAG: ${{ needs.setup-workflow.outputs.VERSION }}
# steps:
#
# - name: Changing version for deb packaging
# run: |
# echo "VERSION=$(echo ${{ env.VERSION }} | sed 's/v//')" >> $GITHUB_ENV
#
# - name: Make archive
# run: |
# ./build_tar.sh ${{ env.PACKAGE_NAME }} ${{ env.VERSION }}
# working-directory: ./build_tools
#
# - name: Upload archive
# uses: actions/upload-artifact@v2
# with:
# name: ${{ env.PACKAGE_NAME }}_${{ env.VERSION }}.tar.gz
# path: build_tools/${{ env.OUTPUT_DIR }}/${{ env.PACKAGE_NAME }}_${{ env.VERSION }}.tar.gz
#
# - name: Install fpm
# run: |
# sudo apt-get install ruby ruby-dev rubygems build-essential
# sudo gem install --no-document fpm
#
# - name: Create deb package
# run: |
# ./build_deb.sh ${{ env.PACKAGE_NAME }} ${{ env.VERSION }}
# working-directory: ./build_tools
#
# - name: Upload deb
# uses: actions/upload-artifact@v2
# with:
# name: ${{ env.PACKAGE_NAME }}_${{ env.VERSION }}_amd64.deb
# path: build_tools/${{ env.OUTPUT_DIR }}/${{ env.PACKAGE_NAME }}_${{ env.VERSION }}_amd64.deb
#
# - uses: "marvinpinto/action-automatic-releases@latest"
# with:
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
# automatic_release_tag: "${{ env.RELEASE_TAG }}"
# prerelease: false
# files: |
# build_tools/${{ env.OUTPUT_DIR }}/${{ env.PACKAGE_NAME }}_${{ env.VERSION }}_amd64.deb
# build_tools/${{ env.OUTPUT_DIR }}/${{ env.PACKAGE_NAME }}_${{ env.VERSION }}.tar.gz
name: cheqd-testnet-image.tar
path: cheqd-testnet-image.tar

publish:
name: "Publish docker images"
# Reference to workflow-setup job is required to access its various outputs.
needs: [ setup-workflow, build-node-image, build-testnet-image, build-deb-package ]
runs-on: ubuntu-latest
env:
GITHUB_REPOSITORY_NAME: ${{ needs.setup-workflow.outputs.GITHUB_REPOSITORY_NAME }}
TAG: ${{ needs.setup-workflow.outputs.TAG }}
VERSION: ${{ needs.setup-workflow.outputs.VERSION }}
PACKAGE_NAME: "cheqd-node"
TESTNET_IMAGE_NAME: "cheqd-testnet"
steps:
- name: Git checkout
uses: actions/checkout@v2

- name: Download node image
uses: actions/download-artifact@v2
with:
name: cheqd-node-image.tar

- name: Load node image
run: docker load -i cheqd-node-image.tar

- name: Download testnet image
uses: actions/download-artifact@v2
with:
name: cheqd-testnet-image.tar

- name: Load testnet image
run: docker load -i cheqd-testnet-image.tar

- name: Login to docker
run: |
echo ${{ secrets.GH_PAT }} | docker login ghcr.io --username ${{ secrets.GH_USER }} --password-stdin
- name: Push node image
run: |
docker tag cheqd-node ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}:${{ env.VERSION }}
docker tag cheqd-node ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}:latest
docker push ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}:${{ env.VERSION }}
docker push ghcr.io/${{ env.GITHUB_REPOSITORY_NAME }}:latest
- name: Push testnet image
run: |
docker tag cheqd-testnet ghcr.io/${{ github.repository_owner }}/${{ env.TESTNET_IMAGE_NAME }}:${{ env.VERSION }}
docker tag cheqd-testnet ghcr.io/${{ github.repository_owner }}/${{ env.TESTNET_IMAGE_NAME }}:latest
docker push ghcr.io/${{ github.repository_owner }}/${{ env.TESTNET_IMAGE_NAME }}:${{ env.VERSION }}
docker push ghcr.io/${{ github.repository_owner }}/${{ env.TESTNET_IMAGE_NAME }}:latest
- name: Download deb
uses: actions/download-artifact@v2
with:
name: ${{ env.PACKAGE_NAME }}_${{ env.VERSION }}_amd64.deb

- name: Load binary artifact
uses: actions/download-artifact@v2
with:
name: cheqd-noded

- name: Restore binary permissions
run: sudo chmod +x cheqd-noded

- name: Make tar archive
run: tar -zcvf ${{ env.PACKAGE_NAME }}_${{ env.VERSION }}.tar.gz cheqd-noded

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.TAG }}"
prerelease: true
files: |
build_tools/output/${{ env.PACKAGE_NAME }}_${{ env.VERSION }}_amd64.deb
build_tools/output/${{ env.PACKAGE_NAME }}_${{ env.VERSION }}.tar.gz

0 comments on commit c7419af

Please sign in to comment.