2020-04-17 18:48:00 -04:00
|
|
|
name: release-workflow
|
2020-04-17 14:22:45 -04:00
|
|
|
|
|
|
|
on:
|
2020-04-17 15:16:39 -04:00
|
|
|
push:
|
2020-04-17 15:56:38 -04:00
|
|
|
branches:
|
|
|
|
- 'master'
|
2020-04-17 14:22:45 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Bump version and publish package(s)
|
|
|
|
|
2021-02-23 19:22:55 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-04-17 14:22:45 -04:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-09-24 06:42:40 -04:00
|
|
|
node-version: [16]
|
2020-04-17 14:22:45 -04:00
|
|
|
|
|
|
|
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-04-17 14:22:45 -04:00
|
|
|
|
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-04-17 14:22:45 -04:00
|
|
|
|
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 }}-
|
2020-04-17 14:22:45 -04:00
|
|
|
|
2021-10-21 22:35:46 -04:00
|
|
|
- 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
|
2021-10-21 22:35:46 -04:00
|
|
|
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:
|
2021-10-21 22:35:46 -04:00
|
|
|
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: |
|
2021-10-21 22:35:46 -04:00
|
|
|
${{ runner.os }}-npm-
|
2020-04-17 14:22:45 -04:00
|
|
|
|
2020-12-10 16:58:10 -05:00
|
|
|
- name: Install dependencies
|
2021-12-22 03:26:12 -05:00
|
|
|
working-directory: ./superset-frontend
|
2021-10-21 22:35:46 -04:00
|
|
|
run: npm ci
|
2020-12-10 16:58:10 -05:00
|
|
|
- name: Run unit tests
|
2021-12-22 03:26:12 -05:00
|
|
|
working-directory: ./superset-frontend
|
2021-12-20 08:58:10 -05:00
|
|
|
run: npm run test -- plugins packages
|
2021-12-22 03:26:12 -05:00
|
|
|
- name: Build packages
|
|
|
|
working-directory: ./superset-frontend
|
|
|
|
run: npm run plugins:build
|
2020-04-17 14:22:45 -04:00
|
|
|
|
2020-12-10 16:58:10 -05:00
|
|
|
- name: Configure npm and git
|
|
|
|
run: |
|
2021-10-07 06:07:31 -04:00
|
|
|
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)
|
2021-12-22 03:26:12 -05:00
|
|
|
working-directory: ./superset-frontend
|
2020-12-10 16:58:10 -05:00
|
|
|
run: |
|
|
|
|
git tag -d `git tag | grep -E '^trigger-'`
|
2021-12-20 08:58:10 -05:00
|
|
|
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 }}
|