Manual NPM Publish #134
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 NPM Publish | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| releaseType: | |
| description: "Release type - major, minor or patch" | |
| required: true | |
| type: choice | |
| default: "patch" | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| distTag: | |
| description: 'NPM tag (e.g. use "next" to release a test version)' | |
| required: true | |
| default: 'latest' | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| jobs: | |
| authorize: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: octokit/[email protected] | |
| with: | |
| route: GET /orgs/:organisation/teams/:team/memberships/${{ github.actor }} | |
| team: technical-steering-committee | |
| organisation: webdriverio | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| release: | |
| needs: [authorize] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| ref: 'v3' | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v1 | |
| with: | |
| node-version: 16.x | |
| - name: NPM Setup | |
| run: | | |
| npm set registry "https://registry.npmjs.org/" | |
| npm set //registry.npmjs.org/:_authToken $NPM_TOKEN | |
| npm whoami | |
| - name: Git Setup | |
| run: | | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "WebdriverIO Release Bot" | |
| - name: Install Dependencies | |
| run: npm ci | |
| - name: Build Project | |
| run: npm run build | |
| env: | |
| NODE_ENV: production | |
| - name: Release | |
| run: npm run release:ci -- ${{github.event.inputs.releaseType}} | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |