Publish npm packages #27
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 npm packages | |
on: | |
workflow_dispatch: | |
inputs: | |
authentication-adapters-version: | |
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version" | |
required: false | |
axios-client-adapter-version: | |
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version" | |
required: false | |
convert-to-stream-version: | |
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version" | |
required: false | |
core-version: | |
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version" | |
required: false | |
core-interfaces-version: | |
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version" | |
required: false | |
file-wrapper-version: | |
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version" | |
required: false | |
http-headers-version: | |
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version" | |
required: false | |
http-query-version: | |
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version" | |
required: false | |
oauth-adapters-version: | |
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version" | |
required: false | |
schema-version: | |
description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version" | |
required: false | |
# xml-adapter-version: | |
# description: "This input field requires version in format: x.y.z, where x => major version, y => minor version and z => patch version" | |
# required: false | |
jobs: | |
build: | |
name: Publish package | |
runs-on: ubuntu-latest | |
steps: | |
# - name: Package version validation | |
# if: ${{ github.event.inputs.authentication-adapters-version == '' && | |
# github.event.inputs.axios-client-adapter-version == '' && | |
# github.event.inputs.convert-to-stream-version == '' && | |
# github.event.inputs.core-version == '' && | |
# github.event.inputs.core-interfaces-version == '' && | |
# github.event.inputs.file-wrapper-version == '' && | |
# github.event.inputs.http-headers-version == '' && | |
# github.event.inputs.http-query-version == '' && | |
# github.event.inputs.oauth-adapters-version == '' && | |
# github.event.inputs.schema-version == '' && | |
# github.event.inputs.xml-adapter-version == '' }} | |
# run: | | |
# echo "No version values provided" | |
# exit 1 | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Use Node 19.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "19.x" | |
# - name: Create and switch to new branch | |
# run: | | |
# git checkout -b release-npm-packages | |
- name: Install dependencies and build | |
run: | | |
yarn install --frozen-lockfile | |
yarn build | |
- name: Bump authentication-adapters package version | |
if: "${{ github.event.inputs.authentication-adapters-version != '' }}" | |
run: | | |
cd packages/authentication-adapters | |
npm version ${{ github.event.inputs.authentication-adapters-version }} | |
# - name: Bump axios-client-adapter package version | |
# if: "${{ github.event.inputs.axios-client-adapter-version != '' }}" | |
# run: | | |
# cd packages/axios-client-adapter | |
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.axios-client-adapter-version }} | |
# - name: Bump convert-to-stream package version | |
# if: "${{ github.event.inputs.convert-to-stream-version != '' }}" | |
# run: | | |
# cd packages/convert-to-stream | |
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.convert-to-stream-version }} | |
# - name: Bump core package version | |
# if: "${{ github.event.inputs.core-version != '' }}" | |
# run: | | |
# cd packages/core | |
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.core-version }} | |
# - name: Bump core-interfaces package version | |
# if: "${{ github.event.inputs.core-interfaces-version != '' }}" | |
# run: | | |
# cd packages/core-interfaces | |
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.core-interfaces-version }} | |
# - name: Bump file-wrapper package version | |
# if: "${{ github.event.inputs.file-wrapper-version != '' }}" | |
# run: | | |
# cd packages/file-wrapper | |
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.file-wrapper-version }} | |
# - name: Bump http-headers package version | |
# if: "${{ github.event.inputs.http-headers-version != '' }}" | |
# run: | | |
# cd packages/http-headers | |
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.http-headers-version }} | |
# - name: Bump http-query package version | |
# if: "${{ github.event.inputs.http-query-version != '' }}" | |
# run: | | |
# cd packages/http-query | |
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.http-query-version }} | |
# - name: Bump oauth-adapters package version | |
# if: "${{ github.event.inputs.oauth-adapters-version != '' }}" | |
# run: | | |
# cd packages/oauth-adapters | |
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.oauth-adapters-version }} | |
# - name: Bump schema package version | |
# if: "${{ github.event.inputs.schema-version != '' }}" | |
# run: | | |
# cd packages/schema | |
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.schema-version }} | |
# - name: Bump xml-adapter package version | |
# if: "${{ github.event.inputs.xml-adapter-version != '' }}" | |
# run: | | |
# cd packages/xml-adapter | |
# ../../node_modules/.bin/lerna version ${{ github.event.inputs.xml-adapter-version }} | |
# - name: Commit and push | |
# uses: stefanzweifel/git-auto-commit-action@v5 | |
# with: | |
# commit_message: "ci: bump package version" | |
# - name: Create Pull Request | |
# uses: peter-evans/create-pull-request@v3 | |
# with: | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# commit-message: "Automated PR creation for bumping package versions" | |
# title: "Changes from action" | |
# body: | | |
# This PR was automatically created by a GitHub Action for bumping package versions. | |
# branch: release-npm-packages | |
# - name: NPM Identity | |
# env: | |
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# run: | | |
# echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc | |
- name: Publish Packages | |
run: | | |
cd packages/authentication-adapters | |
npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# - name: Publish Packages | |
# run: | | |
# ./node_modules/.bin/lerna publish from-package --registry https://registry.npmjs.org/ --yes | |
# env: | |
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |