From 879eeccc7e3341a8af73a2d6efd502e8043c4976 Mon Sep 17 00:00:00 2001 From: Tania Allard Date: Fri, 27 Nov 2020 13:00:16 +0000 Subject: [PATCH] :green_heart: Update release action --- .github/workflows/publish.yml | 30 +++++++++++++++++------------- .github/workflows/test.yml | 12 ++++++++++-- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fd7998d..a339a2a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,9 +1,9 @@ name: npm-publish on: - release: - types: - - published + push: + tags: + - "v*.*.*" jobs: npm-publish: @@ -13,19 +13,23 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v2 - - name: Get project version - id: get_version - run: | - echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV - echo "$VERSION" + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + Changes in this release + draft: false + prerelease: false - uses: actions/setup-node@v1 with: - node-version: 10 + node-version: 12 - run: npm install - - run: npm test - uses: JS-DevTools/npm-publish@v1 with: token: ${{ secrets.NPM_TOKEN }} - tag: "v.$VERSION" - env: - VERSION: ${{ env.VERSION }} \ No newline at end of file + tag: ${{ github.ref }}s \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a21196a..c9cfdf8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,14 @@ jobs: - uses: actions/setup-python@v2 with: python-version: '3.8' + - name: Cache pip on Linux + uses: actions/cache@v1 + if: startsWith(runner.os, 'Linux') + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ matrix.python }}-${{ hashFiles('**/requirements.txt', 'setup.py') }} + restore-keys: | + ${{ runner.os }}-pip-${{ matrix.python }} - name: Install dependencies run: | pip install -U pip setuptools @@ -28,8 +36,8 @@ jobs: - name: Run tests run: | jupyter nbextension list - jupyter nbextension enable --py --sys-prefix jupyter_pitaya_smoothie + jupyter nbextension enable --py --sys-prefix jupyter-pitaya-smoothie pip install jupyterlab jupyter labextension list - jupyter labextension list 2>&1 | grep -q jupyter_pitaya_smoothie + jupyter labextension list 2>&1 | grep -q jupyter-pitaya-smoothie jupyter labextension link \ No newline at end of file