diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 702cd3b..cb0a81a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,37 +18,37 @@ jobs: - name: Get current npm version id: current_version - run: echo "::set-output name=version::$(node -p \"require('./package.json').version\")" + run: echo "version=$(node -p 'require(\"./package.json\").version')" >> $GITHUB_ENV - name: Get previous npm version id: previous_version run: | PREV_VERSION=$(npm view ${{ github.repository }} version) - echo "::set-output name=version::${PREV_VERSION}" + echo "version=${PREV_VERSION}" >> $GITHUB_ENV - name: Check version change id: version_check run: | - if [ "${{ steps.current_version.outputs.version }}" != "${{ steps.previous_version.outputs.version }}" ]; then - echo "::set-output name=changed::true" + if [ "${{ env.version }}" != "${{ env.version }}" ]; then + echo "changed=true" >> $GITHUB_ENV else - echo "::set-output name=changed::false" + echo "changed=false" >> $GITHUB_ENV fi - name: Publish to npm - if: steps.version_check.outputs.changed == 'true' + if: env.changed == 'true' uses: JS-DevTools/npm-publish@v3 with: token: ${{ secrets.NPM_TOKEN }} - name: Create GitHub Release - if: steps.version_check.outputs.changed == 'true' + if: env.changed == 'true' uses: actions/create-release@v1 with: - tag_name: v${{ steps.current_version.outputs.version }} - release_name: Release v${{ steps.current_version.outputs.version }} + tag_name: v${{ env.version }} + release_name: Release v${{ env.version }} body: | - New release v${{ steps.current_version.outputs.version }} + New release v${{ env.version }} draft: false prerelease: false env: