superset/.github/workflows/release.yml

83 lines
2.7 KiB
YAML
Raw Normal View History

2020-04-17 18:48:00 -04:00
name: release-workflow
on:
2020-04-17 15:16:39 -04:00
push:
2020-04-17 15:56:38 -04:00
branches:
- 'master'
jobs:
build:
name: Bump version and publish package(s)
2021-02-23 19:22:55 -05:00
runs-on: ubuntu-20.04
strategy:
matrix:
2021-09-24 06:42:40 -04:00
node-version: [16]
steps:
2020-12-10 16:58:10 -05:00
- uses: actions/checkout@v2
with:
# pulls all commits (needed for lerna / semantic release to correctly version)
fetch-depth: 0
- name: Get tags and filter trigger tags
run: |
git fetch --depth=1 origin "+refs/tags/*:refs/tags/*"
git fetch --prune --unshallow
git tag -d `git tag | grep -E '^trigger-'`
2020-12-10 16:58:10 -05:00
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
2020-12-10 16:58:10 -05:00
- name: Cache npm
uses: actions/cache@v1
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm config get cache)"
- name: Cache npm
2020-12-10 16:58:10 -05:00
uses: actions/cache@v1
id: npm-cache # use this to check for `cache-hit` (`steps.npm-cache.outputs.cache-hit != 'true'`)
2020-12-10 16:58:10 -05:00
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
2020-12-10 16:58:10 -05:00
restore-keys: |
${{ runner.os }}-npm-
2020-12-10 16:58:10 -05:00
- name: Install dependencies
run: npm ci
2020-12-10 16:58:10 -05:00
- name: Build packages
run: npm run plugins:build
2020-12-10 16:58:10 -05:00
- name: Run unit tests
run: npm run test -- plugins packages
2020-12-10 16:58:10 -05:00
- name: Configure npm and git
run: |
echo "@superset-ui:registry=https://registry.npmjs.org/" > .npmrc
echo "registry=https://registry.npmjs.org/" >> .npmrc
2020-12-10 16:58:10 -05:00
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> $HOME/.npmrc 2> /dev/null
npm whoami
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git remote set-url origin "https://${GITHUB_TOKEN}@github.com/apache-superset/superset-ui.git" > /dev/null 2>&1
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2020-04-17 14:38:58 -04:00
2020-12-10 16:58:10 -05:00
- name: Bump version and publish package(s)
run: |
git tag -d `git tag | grep -E '^trigger-'`
npm run plugins:release-from-tag
2020-12-10 16:58:10 -05:00
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}