chore(main): release ui 1.75.1 #710
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "[release]: Release please" | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
command: manifest | |
token: ${{secrets.GITHUB_TOKEN}} | |
default-branch: main | |
# The logic below handles the npm publication: | |
- name: Checkout Repository | |
if: ${{ steps.release.outputs.releases_created }} | |
uses: actions/checkout@v2 | |
- name: Tag for packages/ui | |
if: ${{ steps.release.outputs['packages/ui--release_created'] }} | |
run: | | |
set -x | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/ytsaurus/ytsaurus-ui.git" | |
export TAG=${{ steps.release.outputs['packages/ui--tag_name'] }} | |
git tag -m "Release $TAG" -a $TAG ${{ steps.release.outputs['packages/ui--sha'] }} | |
git push gh-token $TAG | |
- name: Setup Node | |
uses: actions/setup-node@v1 | |
if: ${{ steps.release.outputs.releases_created }} | |
with: | |
node-version: 18 | |
registry-url: "https://registry.npmjs.org" | |
- name: npm ci | |
if: ${{ steps.release.outputs.releases_created }} | |
run: | | |
npm ci | |
# Release Please has already incremented versions and published tags, so we just | |
# need to publish all unpublished versions to NPM here | |
# See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package | |
- name: Publish to NPM | |
if: ${{ steps.release.outputs.releases_created }} | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
run: npx lerna publish from-package --no-push --no-private --yes | |
- name: "Docker: build & push" | |
if: ${{ steps.release.outputs['packages/ui--release_created'] }} | |
run: | | |
cd packages/ui | |
UI_IMAGE=$(npm run -s show:docker-image-name) | |
UI_TAG=$(npm run -s show:version) | |
TARGET_IMAGE=${UI_IMAGE}:${UI_TAG} | |
echo target image and tag: ${TARGET_IMAGE} | |
if ! docker pull ${TARGET_IMAGE} ; then | |
npm run docker:build --dockertag=${UI_TAG} | |
echo '${{ secrets.GITHUB_TOKEN }}' | docker login --username ${{ github.actor }} --password-stdin ghcr.io | |
npm run docker:push --dockertag=${UI_TAG} | |
LATEST_IMAGE=$(echo $UI_IMAGE | sed 's/-nightly//g'):latest | |
docker tag ${TARGET_IMAGE} ${LATEST_IMAGE} | |
docker push ${LATEST_IMAGE} | |
else | |
echo Corresponding image already exists | |
fi |