Merge pull request #4358 from serlo/chore/release-editor-v0.20.2 #608
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: Editor Web Component | |
on: | |
push: | |
branches: | |
- staging | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org | |
- run: yarn | |
- name: Build editor web component package | |
run: yarn editor-web-component:build | |
- name: Check if current version is already published | |
id: check_published | |
run: | | |
CURRENT_VERSION=$(node -p "require('./packages/editor-web-component/package.json').version") | |
if npm view @serlo/editor-web-component@$CURRENT_VERSION > /dev/null 2>&1; then | |
echo "already_published=true" >> $GITHUB_OUTPUT | |
else | |
echo "already_published=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Publish to npm | |
if: steps.check_published.outputs.already_published == 'false' | |
run: yarn editor-web-component:publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |