Publish #2
This file contains 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: "Publish" | |
on: | |
workflow_dispatch: | |
inputs: | |
next_version: | |
type: "string" | |
description: "version (e.g. 3.4.0-alpha.0)" | |
required: true | |
stable_release: | |
type: "boolean" | |
description: "mark in case this is a full stable release" | |
required: true | |
jobs: | |
publish: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: "actions/checkout@v3" | |
- name: "Configure Git Credentials" | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: "Setup node" | |
uses: "actions/setup-node@v3" | |
with: | |
node-version: "16" | |
registry-url: "https://registry.npmjs.org" | |
- uses: "pnpm/[email protected]" | |
name: "Install pnpm" | |
id: "pnpm-install" | |
with: | |
version: "8" | |
run_install: false | |
- name: "Install Packages" | |
run: "pnpm i --frozen-lockfile" | |
- name: "Build" | |
run: "pnpm run build" | |
- name: "Test" | |
run: "pnpm run test" | |
- name: "Versioning" | |
run: "pnpm exec lerna version ${{ github.event.inputs.next_version }} --no-push --force-publish --yes" | |
- name: "Adjust PeerDependencies" | |
run: | | |
cd packages/angular && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" | |
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 }}" | |
cd ../examples && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" | |
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 }}" | |
cd ../react && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" | |
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 }}" | |
cd ../vue && pnpm pkg set peerDependencies.@jsonforms/core="${{ github.event.inputs.next_version }}" | |
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 }}" | |
- name: "Tag and Commit" | |
run: | | |
git add -A && git commit --amend --no-edit | |
git tag v${{ github.event.inputs.next_version }} -f | |
- name: "Publish to npm" | |
run: "pnpm exec lerna publish from-git --yes ${{ github.event.inputs.stable_release == 'true' && ' ' || '--dist-tag next' }}" | |
env: | |
NODE_AUTH_TOKEN: "${{ secrets.NPM_TOKEN }}" | |
- name: "push" | |
run: | | |
git push | |
git push origin v${{ github.event.inputs.next_version }} |