Build and publish Workflow #171
Workflow file for this run
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: Build and Publish Workflow | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| bump: | |
| description: 'Which version bump (patch, minor, major)' | |
| required: true | |
| default: 'patch' | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| jobs: | |
| version-bump: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Bump NPM version | |
| uses: ./.github/action/bump-npm-version | |
| with: | |
| bump: ${{ inputs.bump }} | |
| token: ${{ secrets.GIT_TOKEN_ADMIN }} | |
| repository: ${{ github.repository }} | |
| build: | |
| needs: version-bump | |
| runs-on: ubuntu-latest | |
| name: Npm install and npm build | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup Node with Github Registry | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: '20' | |
| registry-url: https://npm.pkg.github.com/celonis | |
| scope: '@celonis' | |
| - name: Yarn Install | |
| run: yarn install | |
| - name: Yarn Build | |
| run: yarn build | |
| - name: Yarn Test | |
| run: yarn test | |
| - name: Move files to build | |
| run: | | |
| cp README.md dist/README.md | |
| cp LICENSE dist/LICENSE | |
| - name: Publish to Github Registry | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: cd dist/ && npm publish | |
| - name: Setup publish to Npm Registry | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: '16' | |
| registry-url: https://registry.npmjs.org/ | |
| scope: '@celonis' | |
| - name: Publish to Npm Registry | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: cd dist/ && npm publish --access public | |
| - uses: actions/checkout@master | |
| name: Checkout Master | |
| with: | |
| fetch-depth: '0' |