Skip to content

chore(main): release 3.6.0 #162

chore(main): release 3.6.0

chore(main): release 3.6.0 #162

Workflow file for this run

###############################################################
# Copyright (c) 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
###############################################################
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: release
on:
push:
branches:
- main
paths:
- src/**
- package.json
- yarn.lock
- CHANGELOG.md
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
pull-requests: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
check-version:
runs-on: ubuntu-latest
outputs:
version-bumped: ${{ steps.version-check.outputs.bumped }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get latest git tag
id: git-tag-latest
uses: actions-ecosystem/action-get-latest-tag@v1
- name: Remove tag 'v' prefix
run: echo "GIT_VERSION=$(echo ${{ steps.git-tag-latest.outputs.tag }} | cut -c2-)" >> $GITHUB_ENV
- name: Get npm version
id: npm-version
uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # v1.3.1
- name: Output versions
run: |
echo git ${{ env.GIT_VERSION }}
echo npm ${{ steps.npm-version.outputs.current-version }}
- name: Check if version is bumped
id: version-check
run: |
if [[ "${{ env.GIT_VERSION }}" == "${{ steps.npm-version.outputs.current-version }}" ]]; then
echo "Versions match. Skipping publish."
echo "bumped=false" >> $GITHUB_OUTPUT
else
echo "Versions do not match. Proceeding with publish."
echo "bumped=true" >> $GITHUB_OUTPUT
fi
build-and-publish:
runs-on: ubuntu-latest
needs: check-version
if: needs.check-version.outputs.version-bumped == 'true'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Node
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Get npm version
id: npm-tag
uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # v1.3.1
- name: Install Dependencies
run: yarn
- name: Linter Checks
run: yarn lint
- name: Unit Tests
run: CI=true yarn test
- name: Build Library
run: yarn build
- name: Build Storybook
run: yarn build:storybook
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'storybook'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Release Please GitHub Action
uses: googleapis/release-please-action@v4
id: release
with:
release-type: node
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Shared Components to npm
if: ${{ steps.release.outputs.release_created }}
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH }}