Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Move publishing of Go client to GH Actions #715

Merged
merged 5 commits into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ jobs:
# Publish to npm.
echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
npm publish --access=public
# GitHub Actions equivalent of this job (.github/workflows/client.yml)
# has been created as part of work on RFC-18
publish_client:
executor: gcp-gcr/default
steps:
Expand Down
36 changes: 25 additions & 11 deletions .github/workflows/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
workflow_dispatch:

jobs:
build-and-test:
build-test-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -29,6 +29,7 @@ jobs:
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

# TODO: This step was left here intentionally so we can track disk space
# usage for a while. We were trying to fight problems with out of disk space
# that happened due to the size of data restored from cache. The cache size
Expand All @@ -43,7 +44,7 @@ jobs:
target: gobuild
tags: go-build-env
build-args: |
# REVISION=${{ github.sha }} TODO: set revision only when we want to publish the image
REVISION=${{ github.sha }}
# VERSION= ? TODO: Configure version, sample: 1.7.6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we don't need to configure REVISION and VERSION args for go-build-env image. We need to move it to the Build and publish Docker Runtime Image step.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 9fe8814

load: true # load image to local registry to use it in next steps
cache-from: type=local,src=/tmp/.buildx-cache
Expand All @@ -69,14 +70,27 @@ jobs:
check_name: Go Test Results # name under which test results will be presented in GitHub (optional)
comment_on_pr: false # turns off commenting on Pull Requests

# This step is executed after the tests as we want to configure it eventually
# as image publication step.
- name: Build Docker Runtime Image
- name: Login to Google Container Registry
if: |
startsWith(github.ref, 'refs/heads/releases/ropsten')
|| startsWith(github.ref, 'refs/heads/rfc-18/ropsten')
uses: docker/login-action@v1
with:
registry: ${{ secrets.GCR_REGISTRY_URL }}
username: _json_key
password: ${{ secrets.KEEP_TEST_GCR_JSON_KEY }}

- name: Build and publish Docker Runtime Image
uses: docker/build-push-action@v2
env:
IMAGE_NAME: 'keep-ecdsa-wip' # TODO: change later to 'keep-ecdsa'
GOOGLE_PROJECT_ID: ${{ secrets.KEEP_TEST_GOOGLE_PROJECT_ID }}
with:
tags: keep-ecdsa
labels: |
revision=${{ github.sha }}
# TODO: Check branch name and publish to a registry accordingly to the
# environment.
# push: true # publish to registry
# GCR image should be named according to following convention:
# HOSTNAME/PROJECT-ID/IMAGE:TAG
# We don't use TAG yet, will be added at later stages of work on RFC-18.
tags: ${{ secrets.GCR_REGISTRY_URL }}/${{ env.GOOGLE_PROJECT_ID }}/${{ env.IMAGE_NAME }}
labels: revision=${{ github.sha }}
push: |
${{ startsWith(github.ref, 'refs/heads/releases')
|| startsWith(github.ref, 'refs/heads/rfc-18/ropsten') }}