Skip to content

Commit

Permalink
Modify release-ts-api gha (#2760)
Browse files Browse the repository at this point in the history
* modify publish tag

* format

* remove unuse comment

* set env

* add publishConfig

* rename docker tag
  • Loading branch information
0xverin committed May 28, 2024
1 parent bb9f1a2 commit 8bd1e4c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
39 changes: 20 additions & 19 deletions .github/workflows/release-ts-api-package.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# Reference: ci.yml
name: Release Ts API Package

on:
workflow_dispatch:
inputs:
release-tag:
description: "Client-api release tag (e.g. p1.2.0-9701-w0.0.1-101)"
docker-tag:
description: "an existing docker tag (e.g. v0.9.18)"
required: true
release-tag:
description: "client-api release tag"
type: choice
options:
- latest
- next
default: 'latest'

env:
NODE_AUTH_TOKEN: ${{ secrets.RELEASE_TS_API_PACKAGE_TOKEN }}

Expand All @@ -18,25 +25,20 @@ jobs:

- name: Set ENV
run: |
# extracting parachain version and worker version from release tag
PARACHAIN_DOCKER_TAG=$(echo ${{inputs.release-tag}} | cut -d'-' -f1 | sed 's/p/v/')
echo "PARACHAIN_DOCKER_TAG=$PARACHAIN_DOCKER_TAG" >> $GITHUB_ENV
WORKER_DOCKER_TAG=$(echo ${{inputs.release-tag}} | sed 's/.*w/v/;s/-.*//')
echo "WORKER_DOCKER_TAG=$WORKER_DOCKER_TAG" >> $GITHUB_ENV
echo "DOCKER_TAG=${{inputs.docker-tag}}" >> $GITHUB_ENV
- name: Pull litentry image optionally
run: |
docker pull parity/polkadot
docker pull litentry/identity-worker:$WORKER_DOCKER_TAG
docker pull litentry/identity-cli:$WORKER_DOCKER_TAG
docker pull litentry/litentry-parachain:$PARACHAIN_DOCKER_TAG
docker pull litentry/identity-worker:$DOCKER_TAG
docker pull litentry/identity-cli:$DOCKER_TAG
docker pull litentry/litentry-parachain:$DOCKER_TAG
- name: Re-tag docker image
run: |
docker tag litentry/identity-worker:$WORKER_DOCKER_TAG litentry/identity-worker:latest
docker tag litentry/identity-cli:$WORKER_DOCKER_TAG litentry/identity-cli:latest
docker tag litentry/litentry-parachain:$PARACHAIN_DOCKER_TAG litentry/litentry-parachain:latest
docker tag litentry/identity-worker:$DOCKER_TAG litentry/identity-worker:latest
docker tag litentry/identity-cli:$DOCKER_TAG litentry/identity-cli:latest
docker tag litentry/litentry-parachain:$DOCKER_TAG litentry/litentry-parachain:latest
- run: docker images --all

Expand All @@ -61,12 +63,11 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://npm.pkg.github.com/
registry-url: "https://registry.npmjs.org"

- name: Setup npm config
run: |
echo "//npm.pkg.github.com/:_authToken=\${{ secrets.RELEASE_TS_API_PACKAGE_TOKEN }}" > .npmrc
npm config set @litentry:registry https://npm.pkg.github.com
echo "//registry.npmjs.org/:_authToken=${{ secrets.RELEASE_TS_API_PACKAGE_TOKEN }}" > .npmrc
- name: Publish parachain API and sidechain API
working-directory: ./tee-worker/client-api
Expand All @@ -82,7 +83,7 @@ jobs:
echo "$api dist and build files do not exist. Publishing failed."
exit 1
fi
npm publish --tag ${{ inputs.release-tag }}
npm publish --tag ${{inputs.release-tag}}
echo "------------------------$api published------------------------"
cd ..
Expand Down
3 changes: 3 additions & 0 deletions tee-worker/client-api/parachain-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
"publishConfig": {
"access": "public"
},
"packageManager": "pnpm@8.7.6"
}
3 changes: 3 additions & 0 deletions tee-worker/client-api/sidechain-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
"publishConfig": {
"access": "public"
},
"packageManager": "pnpm@8.7.6"
}

0 comments on commit 8bd1e4c

Please sign in to comment.