name: "release" on: push: tags: - "v*" jobs: npm-publish: name: "Publish" runs-on: ubuntu-latest defaults: run: shell: bash steps: - name: Checkout repository uses: actions/checkout@v2 - name: Set env run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV ### Set version - name: Set version to ${{ env.RELEASE_VERSION }} run: npm version --new-version --allow-same-version ${{ env.RELEASE_VERSION }} --no-git-tag-version ### Publish to NPM registry - uses: actions/setup-node@v1 with: node-version: '14' registry-url: 'https://registry.npmjs.org' - run: npm i - run: npm run build - run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} ### Create a release - name: Build Changelog id: changelog uses: mikepenz/release-changelog-builder-action@v1 with: configuration: ".github/workflows/changelog_config.json" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Release id: release uses: softprops/action-gh-release@v1 with: name: Fluence JS ${{ env.RELEASE_VERSION }} tag_name: ${{ env.RELEASE_VERSION }} body: ${{steps.changelog.outputs.changelog}} draft: false prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}