Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Commit

Permalink
feat: use npm dev package for sdk (#295)
Browse files Browse the repository at this point in the history
Co-authored-by: Raphael Flechtner <flechtner@galaniprojects.de>
  • Loading branch information
tjwelde and rflechtner authored Dec 2, 2020
1 parent 30a13cc commit a507a94
Show file tree
Hide file tree
Showing 9 changed files with 324 additions and 225 deletions.
10 changes: 10 additions & 0 deletions .github/sdk-update-issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: fix code after sdk-js upgrade
labels: bug
---

_Note: This issue was **automatically created** because the CI pipeline broke after an update in the SDK on {{ date | date('YYYY-MM-D')}}._

Please **fix the code inside this repository** for which the CI broke after pushing [{{ env.SHA }}]({{ env.URL }}) on the develop branch of the SDK.
**You do not have to fix something in the SDK!**
This issue just displays a breaking change was made to the SDK.
6 changes: 0 additions & 6 deletions .github/workflows/kube-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ jobs:
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: set sdk dependency to 'latest' & set up .npmrc to connect to github packages
run: |
echo $(jq '.dependencies."@kiltprotocol/sdk-js"="latest"' package.json) > package.json
mv -f .npmrc.github .npmrc
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
Expand All @@ -44,7 +39,6 @@ jobs:
docker build \
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \
-t $ECR_REGISTRY/$ECR_REPOSITORY:$SHA_IMAGE_TAG \
--build-arg NODE_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }} \
.
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$SHA_IMAGE_TAG
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/test-sdk-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test SDK Update

on:
repository_dispatch:
types: [sdk-update]

jobs:
integration_test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Use Node.js 10
uses: actions/setup-node@v1
with:
node-version: 10

- name: Upgrade sdk to latest dev version
run: yarn upgrade @kiltprotocol/sdk-js@dev

- name: Test demo-client
run: |
yarn lint
yarn build
- name: Create issue on failure
if: ${{ failure() }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
title: fix code after sdk-js upgrade
labels: bug
assignees: ${{ github.event.client_payload.github.sender.login }}
SHA: ${{ github.event.client_payload.github.sha }}
URL: https://github.com/KILTprotocol/sdk-js/commit/${{ github.event.client_payload.github.sha }}
with:
filename: .github/sdk-update-issue-template.md
6 changes: 1 addition & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://npm.pkg.github.com
scope: '@kiltprotocol'
- name: yarn install, lint and build
run: |
yarn upgrade --scope @kiltprotocol --latest
yarn install
yarn lint
yarn build
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

3 changes: 0 additions & 3 deletions .npmrc.github

This file was deleted.

4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
ARG NODE_VERSION=10
FROM node:${NODE_VERSION}-alpine as develop
ARG NODE_AUTH_TOKEN=""

WORKDIR /app

RUN apk add --no-cache bash

COPY package.json yarn.lock ./
COPY ?npmrc ?yarnrc ./
RUN yarn install

COPY . ./

RUN rm -f .npmrc

EXPOSE 3001
CMD [ "yarn", "start" ]

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"dependencies": {
"@babel/core": "^7.10.4",
"@kiltprotocol/sdk-js": "^0.19.1-be43462.0",
"@kiltprotocol/sdk-js": "^0.19.1-2",
"@polkadot/ui-identicon": "^0.33.1",
"@types/react-select": "^2.0.11",
"@types/reselect": "^2.2.0",
Expand Down
Loading

0 comments on commit a507a94

Please sign in to comment.