Merge pull request #281 from NVE/feature/semantic-release-8 #142
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: Build and Release for Test 2 | |
on: | |
push: | |
branches: | |
- test-release | |
paths: | |
- 'src/**' | |
- 'build/**' | |
- 'public/css/**' | |
workflow_dispatch: | |
jobs: | |
build_and_release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Enforce Conventional PR Title | |
uses: CondeNast/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Semantic Release | |
run: npx semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_PUBLISH }} | |
- name: Configure Git for npm version | |
if: ${{ steps.semantic-release.outputs.new-release-published == 'true' }} | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Designsystem" | |
- name: Push tags and changes | |
if: ${{ steps.semantic-release.outputs.new-release-published == 'true' }} | |
run: git push --follow-tags |