Skip to content

Commit

Permalink
ci: run ci only once per push and add release-dry-run
Browse files Browse the repository at this point in the history
  • Loading branch information
mariobuikhuizen committed Feb 27, 2024
1 parent 6ea0ce2 commit b4e2e32
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Build

on:
- push
- pull_request
- workflow_dispatch
push:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
code-quality:
Expand Down Expand Up @@ -132,9 +134,32 @@ jobs:
name: ipyvue-test-results
path: test-results

release-dry-run:
needs: [ test,ui-test,code-quality ]
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v3
with:
name: ipyvue-dist-${{ github.run_number }}

- name: Install node
uses: actions/setup-node@v1
with:
node-version: "14.x"
registry-url: "https://registry.npmjs.org"

- name: Publish the NPM package
run: |
cd js
echo $PRE_RELEASE
if [[ $PRE_RELEASE == "true" ]]; then export TAG="next"; else export TAG="latest"; fi
npm publish --dry-run --tag ${TAG} --access public *.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
PRE_RELEASE: ${{ github.event.release.prerelease }}
release:
if: startsWith(github.event.ref, 'refs/tags/v')
needs: [test,ui-test,code-quality]
needs: [release-dry-run]
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v3
Expand Down

0 comments on commit b4e2e32

Please sign in to comment.