mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 15:06:27 +00:00
66 lines
2 KiB
YAML
66 lines
2 KiB
YAML
name: release-npm
|
|
on:
|
|
repository_dispatch:
|
|
types: [renovate-release]
|
|
|
|
env:
|
|
CI: true
|
|
YARN_CACHE_KEY: v1
|
|
BUILDX_VERSION: v0.3.1
|
|
NODE_VERSION: 12
|
|
# https://github.com/chalk/supports-color/issues/106
|
|
FORCE_COLOR: true
|
|
|
|
jobs:
|
|
release-npm:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
- name: Init platform
|
|
id: init
|
|
run: |
|
|
echo "::set-output name=yarn_cache::$(yarn cache dir)"
|
|
git config --global core.autocrlf false
|
|
git config --global core.symlinks true
|
|
git config --global user.email 'bot@renovateapp.com'
|
|
git config --global user.name 'Renovate Bot'
|
|
yarn config set version-git-tag false
|
|
npm config set scripts-prepend-node-path true
|
|
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ github.event.client_payload.sha }}
|
|
|
|
- name: Cache Yarn packages
|
|
id: yarn_cache_packages
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ${{ steps.init.outputs.yarn_cache }}
|
|
key: ${{ env.YARN_CACHE_KEY }}-${{ runner.os }}-yarn_cache-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
- name: Cache node_modules
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
- name: Installing dependencies
|
|
run: yarn install --frozen-lockfile --link-duplicates
|
|
|
|
- name: Build ${{ github.event.client_payload.version }}
|
|
run: yarn build
|
|
|
|
- name: Prepare ${{ github.event.client_payload.version }}
|
|
run: |
|
|
npm --no-git-tag-version version ${{ github.event.client_payload.version }}
|
|
|
|
- name: Publish ${{ github.event.client_payload.version }}
|
|
run: |
|
|
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> ~/.npmrc
|
|
npm publish
|
|
env:
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|