Publish #8
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 Package | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: npm ci | |
- name: Get tag version | |
id: get_tag_version | |
run: echo "::set-output name=tag_version::${GITHUB_REF#refs/tags/}" | |
- name: Update package.json version | |
run: | | |
cd projects/layout-components | |
npm version --no-git-tag-version ${{ steps.get_tag_version.outputs.tag_version }} | |
git config --global user.name "nemobot" | |
git config --global user.email "[email protected]" | |
git add package.json | |
git commit -m "Update package version" | |
git push origin HEAD:main | |
- name: Build package | |
run: npm run ng build layout-components | |
- name: Publish package | |
run: | | |
cd dist/layout-components | |
npm publish --access public --scope @buildo | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |