Merge pull request #299 from adobe/legendKeys #51
Workflow file for this run
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: Publish library | |
on: | |
push: | |
tags: | |
- 'v*.*.*' # Only trigger on tags that match the pattern 'vX.X.X' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Extract Tag | |
id: extract_tag | |
run: | | |
echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_ENV" | |
echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" | |
- name: Update Package Version | |
run: | | |
sed -i "s/\"version\": \".*\"/\"version\": \"$tag\"/" package.json | |
- name: Install Dependencies | |
run: yarn install | |
- name: Build | |
run: yarn build | |
- name: Publish Package | |
run: yarn publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Update package version to ${{ steps.extract_tag.outputs.tag }}" | |
title: "Update package version to ${{ steps.extract_tag.outputs.tag }}" | |
body: "This PR updates the version in package.json to ${{ steps.extract_tag.outputs.tag }}." | |
branch: "release-${{ steps.extract_tag.outputs.tag }}" | |
base: "main" |