π Manual Release #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: π Manual Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| release_type: | |
| description: 'Release Type' | |
| required: true | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: π οΈ Setup Git | |
| run: | | |
| git config --global user.name 'GitHub Actions Bot' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| - name: π οΈ Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18.x' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: π οΈ Install dependencies | |
| run: yarn | |
| - name: π οΈ Build | |
| run: yarn build | |
| - name: π’ Create new version | |
| run: | | |
| npm version ${{ inputs.release_type }} | |
| - name: π Push changes | |
| run: | | |
| git push | |
| git push --tags | |
| - name: π Publish to NPM | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: π Get version | |
| id: version | |
| run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV | |
| - name: π Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: v${{ env.VERSION }} | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |