Skip to content
Open
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
85 changes: 85 additions & 0 deletions .github/workflows/build-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: indy-node-build-cd

on: [push, workflow_dispatch]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
setup-workflow:
runs-on: ubuntu-latest
outputs:
CACHE_KEY_LINT: ${{ steps.cache.outputs.CACHE_KEY_LINT }}
CACHE_KEY_BUILD: ${{ steps.cache.outputs.CACHE_KEY_BUILD }}
# Expose the lowercase version of the GitHub repository name
# to all subsequent jobs that reference image repositories
# as the push and pull operations require the URL of the repository
# to be in lowercase.
GITHUB_REPOSITORY_NAME: ${{ steps.cache.outputs.GITHUB_REPOSITORY_NAME }}
PACKAGE_NAME: ${{ steps.init.outputs.PACKAGE_NAME }}
PACKAGE_VERSION: ${{ steps.init.outputs.PACKAGE_VERSION }}
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Set outputs
id: cache
run: |
echo "::set-output name=CACHE_KEY_LINT::${{ hashFiles('.github/workflows/lint/Dockerfile') }}"
echo "::set-output name=CACHE_KEY_BUILD::${{ hashFiles('.github/workflows/build/Dockerfile') }}"
echo "::set-output name=GITHUB_REPOSITORY_NAME::$(echo ${GITHUB_REPOSITORY})"
build-package:
needs: setup-workflow
runs-on: ubuntu-latest
env:
PACKAGE_NAME: ${{ needs.setup-workflow.outputs.PACKAGE_NAME }}
PACKAGE_VERSION: ${{ needs.setup-workflow.outputs.PACKAGE_VERSION }}
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Build package
run: |
cd build-scripts/ubuntu-1604
# TODO: Cache the image, optimize scripts, remove default versions
./build-indy-node-docker.sh "${PWD}/../.." 1.0.0 "${PWD}"
ls
- name: Archive package
uses: actions/upload-artifact@v2
with:
name: indy-node-build-cd
path: build-scripts/ubuntu-1604/indy-node_1.0.0_amd64.deb

publish-to-github:
needs: [setup-workflow, build-package]
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ needs.setup-workflow.outputs.BRANCH_NAME }}
PACKAGE_NAME: ${{ needs.setup-workflow.outputs.PACKAGE_NAME }}
PACKAGE_VERSION: ${{ needs.setup-workflow.outputs.PACKAGE_VERSION }}
outputs:
PACKAGE_URL: ${{ steps.upload-release-asset.outputs.browser_download_url }}
steps:
- name: Restore package
uses: actions/download-artifact@v2
with:
name: indy-node-build-cd
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.CR_PAT }}
with:
# TODO: Better naming
tag_name: ${{ env.PACKAGE_VERSION }}-${{ github.run_number }}
release_name: ${{ env.PACKAGE_VERSION }}-${{ github.run_number }}
body: new version ${{ env.PACKAGE_VERSION }}-${{ env.GITHUB_RUN_NUMBER }} release
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.CR_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.PACKAGE_NAME }}_${{ env.PACKAGE_VERSION }}_amd64.deb
asset_name: ${{ env.PACKAGE_NAME }}_${{ env.PACKAGE_VERSION }}_amd64.deb
asset_content_type: application/vnd.debian.binary-package

2 changes: 1 addition & 1 deletion build-scripts/ubuntu-1604/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN apt-get update -y && apt-get install -y \
# issues with pip>=10:
# https://github.com/pypa/pip/issues/5240
# https://github.com/pypa/pip/issues/5221
RUN python3 -m pip install -U pip setuptools \
RUN python3 -m pip install -U pip==10.0.0 setuptools==20.7.0 \
&& pip3 list

# install fpm
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/ubuntu-1604/build-indy-node-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else
fi

docker build -t "${IMAGE_NAME}" -f Dockerfile .
docker volume create --name "${OUTPUT_VOLUME_NAME}"
# docker volume create --name "${OUTPUT_VOLUME_NAME}"

docker run \
-i \
Expand Down