Bump release-it from 17.4.0 to 17.10.0 #1552
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Build and Release | |
on: | |
push: | |
branches: [main] | |
tags: | |
- v* # Our tags are prefixed with 'v' | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [19.x] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Setup cache for npm | |
id: npm_cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.npm | |
~/cache | |
!~/cache/exclude | |
**/node_modules | |
key: npm-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | |
- name: npm install | |
if: steps.npm_cache.outputs.cache-hit != 'true' | |
run: npm install-clean | |
- run: npm run test | |
deploy_site: | |
if: ${{ contains(github.ref, 'refs/tags') }} | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [19.x] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Setup cache for npm | |
id: npm_cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.npm | |
~/cache | |
!~/cache/exclude | |
**/node_modules | |
key: npm-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | |
- name: npm install | |
if: steps.npm_cache.outputs.cache-hit != 'true' | |
run: npm install-clean | |
- run: ./scripts/dist | |
env: | |
SKIP_RELEASE_BUNLDE: true | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages # The branch the action should deploy to. | |
folder: dist/site # The folder the action should deploy. | |
clean: true # Automatically remove deleted files from the deploy branch | |
publish: | |
if: ${{ contains(github.ref, 'refs/tags') }} | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [19.x] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: 'https://registry.npmjs.org' | |
- name: Setup cache for npm | |
id: npm_cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.npm | |
~/cache | |
!~/cache/exclude | |
**/node_modules | |
key: npm-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | |
- name: npm install | |
if: steps.npm_cache.outputs.cache-hit != 'true' | |
run: npm install --frozen-lockfile | |
- run: ./scripts/dist | |
- name: Publish to Node Packages | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- name: Get current tag name | |
id: tag_name | |
uses: dawidd6/action-get-tag@v1 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ steps.tag_name.outputs.tag }} | |
release_name: ${{ steps.tag_name.outputs.tag }} | |
body: | | |
Release ${{ steps.tag_name.outputs.tag }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: innoq-styleguide-${{ steps.tag_name.outputs.tag }}.zip | |
asset_name: innoq-styleguide-${{ steps.tag_name.outputs.tag }}.zip | |
asset_content_type: application/zip |