v3.2.0 #25
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: release | |
on: | |
release: # Docs: <https://git.io/JeBz1#release-event-release> | |
types: [published] | |
env: | |
NODE_VERSION: '18' | |
jobs: | |
npmjs: | |
name: Publish JS package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Setup NodeJS | |
uses: actions/setup-node@v1 # Action page: <https://github.com/actions/setup-node> | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
registry-url: 'https://registry.npmjs.org' | |
scope: '@avto-dev' | |
- name: Generate version value | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | |
run: echo "::set-env name=PACKAGE_VERSION::${GITHUB_REF##*/v}" | |
- uses: actions/cache@v2 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
run: yarn install | |
- name: Set package version | |
run: yarn version --no-git-tag-version --no-commit-hooks --new-version "$PACKAGE_VERSION" | |
- name: Build component | |
run: yarn build | |
- name: Publish package | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: yarn publish --access public --non-interactive | |
demo: | |
name: Update demonstration, hosted on github pages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Setup NodeJS | |
uses: actions/setup-node@v1 # Action page: <https://github.com/actions/setup-node> | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Generate version value | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | |
run: echo "::set-env name=PACKAGE_VERSION::${GITHUB_REF##*/v}" | |
- uses: actions/cache@v2 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
run: yarn install | |
- name: Set package version | |
run: yarn version --no-git-tag-version --no-commit-hooks --new-version "$PACKAGE_VERSION" | |
- name: Build component demo | |
run: yarn build:demo | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: demo | |
path: dist-demo/ | |
- name: Switch to github pages branch | |
uses: actions/checkout@v2 | |
with: | |
ref: gh-pages | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: demo | |
- name: Setup git | |
run: | | |
git config --global user.name "$GITHUB_ACTOR" | |
git config --global user.email '[email protected]' | |
git remote add github "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY.git" | |
- name: Stage changes | |
run: git add . | |
- name: Commit changes | |
run: git commit -m "Deploying ${GITHUB_SHA} to Github Pages" | |
- name: Push changes | |
run: git push github --force |