|
| 1 | +name: "Publish" |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + next_version: |
| 7 | + type: "string" |
| 8 | + description: "version (e.g. 3.4.0-alpha.0)" |
| 9 | + required: true |
| 10 | + stable_release: |
| 11 | + type: "boolean" |
| 12 | + description: "mark in case this is a full stable release" |
| 13 | + required: true |
| 14 | + |
| 15 | +jobs: |
| 16 | + publish: |
| 17 | + runs-on: "ubuntu-latest" |
| 18 | + steps: |
| 19 | + - uses: "actions/checkout@v3" |
| 20 | + |
| 21 | + - name: "Configure Git Credentials" |
| 22 | + run: | |
| 23 | + git config user.name "github-actions[bot]" |
| 24 | + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| 25 | +
|
| 26 | + - name: "Setup node" |
| 27 | + uses: "actions/setup-node@v3" |
| 28 | + with: |
| 29 | + node-version: "16" |
| 30 | + registry-url: "https://registry.npmjs.org" |
| 31 | + |
| 32 | + |
| 33 | + name: "Install pnpm" |
| 34 | + id: "pnpm-install" |
| 35 | + with: |
| 36 | + version: "8" |
| 37 | + run_install: false |
| 38 | + |
| 39 | + - name: "Install Packages" |
| 40 | + run: "pnpm i --frozen-lockfile" |
| 41 | + |
| 42 | + - name: "Build" |
| 43 | + run: "pnpm run build" |
| 44 | + |
| 45 | + - name: "Test" |
| 46 | + run: "pnpm run test" |
| 47 | + |
| 48 | + - name: "Versioning" |
| 49 | + run: "pnpm exec lerna version ${{ github.event.inputs.next_version }} --no-push --force-publish -y" |
| 50 | + |
| 51 | + - name: "Adjust PeerDependencies" |
| 52 | + run: | |
| 53 | + cd packages/angular && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" |
| 54 | + cd ../angular-material && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" && pnpm pkg set peerDependencies.@jsonforms/angular="${{ github.event.inputs.next_version }}" |
| 55 | + cd ../examples && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" |
| 56 | + cd ../material-renderers && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" && pnpm pkg set peerDependencies.@jsonforms/react="${{ github.event.inputs.next_version }}" |
| 57 | + cd ../react && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" |
| 58 | + cd ../vanilla-renderers && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" && pnpm pkg set peerDependencies.@jsonforms/react="${{ github.event.inputs.next_version }}" |
| 59 | + cd ../vue && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" |
| 60 | + cd ../vue-vanilla && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" && pnpm pkg set peerDependencies.@jsonforms/vue="${{ github.event.inputs.next_version }}" |
| 61 | +
|
| 62 | + - name: "Tag and Commit" |
| 63 | + run: | |
| 64 | + git add -A && git commit --amend --no-edit |
| 65 | + git tag v${{ github.event.inputs.next_version }} -f |
| 66 | +
|
| 67 | + - name: "Publish to npm" |
| 68 | + run: "pnpm exec lerna publish from-git ${{ github.event.inputs.stable_release == 'true' && ' ' || '--dist-tag next' }}" |
| 69 | + env: |
| 70 | + NODE_AUTH_TOKEN: "${{ secrets.NPM_TOKEN }}" |
| 71 | + |
| 72 | + - name: "push" |
| 73 | + run: | |
| 74 | + git push |
| 75 | + git push origin v${{ github.event.inputs.next_version }} |
0 commit comments