diff --git a/.github/workflows/publish-package-on-release.txt b/.github/workflows/publish-package-on-release.txt deleted file mode 100644 index c80c86d5..00000000 --- a/.github/workflows/publish-package-on-release.txt +++ /dev/null @@ -1,37 +0,0 @@ -name: Publish Package on Release -on: - push: - branches: - - main - paths: - - 'CHANGELOG.md' -jobs: - release: - name: publish - runs-on: ubuntu-latest - steps: - - name: Checkout ๐Ÿ›Ž๏ธ - uses: actions/checkout@v2.3.1 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. - with: - fetch-depth: 0 - - name: Node - uses: actions/setup-node@v3 # set up node 12 on the machine - with: - node-version: '16' - registry-url: 'https://registry.npmjs.org' - - # install dependencies - - name: Install ๐Ÿ”ง - run: npm ci - - # test components - - name: Test ๐Ÿงช - run: npm run test - env: - CI: true - - # Publish the package - - name: Publish the package - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN_DTSSTN }} \ No newline at end of file diff --git a/.github/workflows/publish-package-on-release.yml b/.github/workflows/publish-package-on-release.yml new file mode 100644 index 00000000..884753df --- /dev/null +++ b/.github/workflows/publish-package-on-release.yml @@ -0,0 +1,28 @@ +name: Publish Package on Release +on: + push: + branches: + - main + paths: + - 'CHANGELOG.md' +jobs: + release: + name: publish + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + if: ${{ steps.release.outputs.release_created }} + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: 'https://registry.npmjs.org' + if: ${{ steps.release.outputs.release_created }} + - run: npm ci + if: ${{ steps.release.outputs.release_created }} + - run: npm run test + env: + CI: true + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_AUTOMATION_TOKEN_DTSSTN}} + if: ${{ steps.release.outputs.release_created }} \ No newline at end of file