2.5.0 #65
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 | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
npm: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
registry-url: https://registry.npmjs.org | |
- name: Check version | |
id: version | |
run: | | |
echo "::set-output name=name::$(jq -r '.name' package.json)" | |
echo "::set-output name=current::$(jq -r '.version' package.json)" | |
echo "::set-output name=published::$(npm view $(jq -r '.name' package.json)@$(jq -r '.version' package.json) version)" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish ${{ steps.version.outputs.name }}@${{ steps.version.outputs.current }} | |
if: ${{ endsWith(github.ref, format('v{0}', steps.version.outputs.published)) == false }} | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
github: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
registry-url: https://npm.pkg.github.com | |
- name: Check version | |
id: version | |
run: | | |
echo "::set-output name=name::$(jq -r '.name' package.json)" | |
echo "::set-output name=current::$(jq -r '.version' package.json)" | |
echo "::set-output name=published::$(npm view $(jq -r '.name' package.json)@$(jq -r '.version' package.json) version)" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish ${{ steps.version.outputs.name }}@${{ steps.version.outputs.current }} | |
if: ${{ endsWith(github.ref, format('v{0}', steps.version.outputs.published)) == false }} | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Sentry release | |
uses: getsentry/action-release@v1 | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: ${{ github.repository_owner }} | |
SENTRY_PROJECT: ${{ github.event.repository.name }} | |
with: | |
version: ${{ steps.version.outputs.current }} | |
version_prefix: ${{ github.event.repository.name }}@ | |
docs: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v3 | |
id: import_gpg | |
with: | |
git-user-signingkey: true | |
git-commit-gpgsign: true | |
git-committer-name: ${{ secrets.GIT_USER_NAME }} | |
git-committer-email: ${{ secrets.GIT_USER_EMAIL }} | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Get yarn cache directory | |
id: yarn-cache-dir | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Yarn cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.yarn-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Node modules cache | |
uses: actions/cache@v2 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile --non-interactive | |
- name: Get version | |
id: version | |
run: | | |
echo "::set-output name=current::$(jq -r '.version' package.json)" | |
- name: Documentation | |
run: yarn run docs:build | |
- name: Publish ${{ steps.version.outputs.current }} | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
personal_token: ${{ secrets.GH_TOKEN }} | |
publish_dir: .docs | |
destination_dir: ${{ steps.version.outputs.current }} | |
keep_files: true | |
user_name: ${{ secrets.GIT_USER_NAME }} | |
user_email: ${{ secrets.GIT_USER_EMAIL }} | |
- name: Publish latest | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
personal_token: ${{ secrets.GH_TOKEN }} | |
publish_dir: .docs | |
keep_files: true | |
user_name: ${{ secrets.GIT_USER_NAME }} | |
user_email: ${{ secrets.GIT_USER_EMAIL }} |