Skip to content

Fixed echo output

Fixed echo output #101

name: Featurebranch
on:
push:
branches-ignore:
- 'master'
- 'develop'
- '*android*'
jobs:
# ==========================================================================
# Create Github tag/release and export short SHA of current HEAD
prepareRelease:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.url }}
github_sha_short: ${{ steps.slug.outputs.sha8 }}
alias_release: ${{ steps.determine_release.outputs.alias_release }}
steps:
- uses: actions/checkout@v1
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S')"
- name: Extract branch name
id: extract_branch
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Set Alias release/tag name
id: determine_release
run: |
if [[ ${{ steps.extract_branch.outputs.branch }} = master ]] ; then
majorVersion=$(grep CLIENT_VERSION_MAJOR ${{ github.workspace }}/CMakeLists.txt | head -n1 | cut -d ' ' -f2 | sed 's/)//g' | tr -d '\\n' | tr -d '\\r' | sed 's/ //g')
minorVersion=$(grep CLIENT_VERSION_MINOR ${{ github.workspace }}/CMakeLists.txt | head -n1 | cut -d ' ' -f2 | sed 's/)//g' | tr -d '\\n' | tr -d '\\r' | sed 's/ //g')
bugfixVersion=$(grep CLIENT_VERSION_REVISION ${{ github.workspace }}/CMakeLists.txt | head -n1 | cut -d ' ' -f2 | sed 's/)//g' | tr -d '\\n' | tr -d '\\r' | sed 's/ //g')
echo "::set-output name=alias_release::$(printf '%s.%s.%s' $majorVersion $minorVersion $bugfixVersion)"
else
echo "::set-output name=alias_release::gh-actions${{ github.run_number }}"
fi
# ==========================================================================
# Build Ubuntu 20.04 version, which is also base for Alias Docker image
# This steps is followed by the Docker image build
buildLinuxBinariesAlsoForDockerImage:
runs-on: ubuntu-latest
needs: prepareRelease
outputs:
github_sha_short: ${{ needs.prepareRelease.outputs.github_sha_short }}
alias_release: ${{ needs.prepareRelease.outputs.alias_release }}
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Build docker image
run: >
echo "Skipped for now..."
env:
GITHUB_CI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ==========================================================================
# Build Alias Docker image
# Based on the content of https://github.com/aliascash/docker-aliaswalletd
buildDockerImage:
runs-on: ubuntu-latest
needs: buildLinuxBinariesAlsoForDockerImage
steps:
# Get installer repo content
- uses: actions/checkout@v2
with:
persist-credentials: false
repository: aliascash/docker-aliaswalletd
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }} #use username, not email
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
context: .
tags: aliascash/docker-aliaswalletd:latest,aliascash/docker-aliaswalletd:${{ needs.buildLinuxBinariesAlsoForDockerImage.outputs.alias_release }}
build-args: |
DOWNLOAD_URL=https://github.com/aliascash/alias-wallet/releases/download/gh-actions5/Alias-gh-actions5-e1fa0f87-Ubuntu-20-04.tgz
#arg2=value2
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}