diff --git a/.github/actions/release-nodejs-enabler/action.yml b/.github/actions/release-nodejs-enabler/action.yml new file mode 100644 index 0000000000..f473f4d28e --- /dev/null +++ b/.github/actions/release-nodejs-enabler/action.yml @@ -0,0 +1,45 @@ +name: Release NodeJS Enabler +description: Release NodeJS Enabler to NPM Registry +inputs: + version: + description: Version to be released + required: false + default: "" + scope: + description: Automatic increment of the semver (patch, minor, major) unless specific version is provided + required: false + default: patch + npm-token: + description: NPM Registry publishing token + required: true + default: "" + +runs: + using: composite + steps: + + - name: Update version manually + if: inputs.version != '' + shell: bash + run: | + cd onboarding-enabler-nodejs + sed -i.bak "s/\"version\": \".*\"/\"version\": \"$NEW_VERSION\"/" package.json + env: + NEW_VERSION: ${{ inputs.version }} + + - name: Release to NPM automatic + shell: bash + run: | + cd onboarding-enabler-nodejs + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc + npm version ${{ inputs.scope }} + npm publish --access public + git add package.json + git add package-lock.json + git commit -m "[skip ci] Update version" + git push --no-verify + cd .. + env: + NPM_TOKEN: ${{ inputs.npm-token }} + + - uses: ./.github/actions/teardown diff --git a/.github/actions/release-python-enabler/action.yml b/.github/actions/release-python-enabler/action.yml new file mode 100644 index 0000000000..b2483cc733 --- /dev/null +++ b/.github/actions/release-python-enabler/action.yml @@ -0,0 +1,80 @@ +name: Release Python Enabler +description: Release Python Enabler +inputs: + version: + description: Version to be released + required: false + default: "" + dry-run: + description: Dry run python release + required: false + default: "false" + zowe-robot-user: + description: Zowe Robot User + required: true + default: "" + zowe-robot-email: + description: Zowe Robot Email + required: true + default: "" + zowe-robot-token: + description: Zowe Robot Password + required: true + default: "" + github-token: + description: Github token + required: true + default: "" + twine-password: + description: Twine password + required: true + default: "" + +runs: + using: composite + steps: + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.14" + + - name: Install Dependencies + shell: bash + run: | + cd onboarding-enabler-python + python -m venv venv + source venv/bin/activate + python -m pip install --upgrade pip setuptools wheel twine build + if [ -f Pipfile.lock ]; then + pip install pipenv + pipenv install --deploy --ignore-pipfile + fi + + - name: Build Python Package + shell: bash + run: | + export SETUPTOOLS_SCM_PRETEND_VERSION=${{ inputs.version }} + ./gradlew onboarding-enabler-python:buildPython + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels + path: onboarding-enabler-python/dist/ + + - name: Install twine globally + shell: bash + run: python -m pip install --upgrade twine + + - uses: zowe-actions/octorelease@v1 + env: + GIT_COMMITTER_NAME: ${{ inputs.zowe-robot-user }} + GIT_COMMITTER_EMAIL: ${{ inputs.zowe-robot-email }} + GIT_CREDENTIALS: x-access-token:${{ inputs.zowe-robot-token }} + GITHUB_TOKEN: ${{ inputs.github-token }} + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ inputs.twine-password }} + with: + working-dir: onboarding-enabler-python + dry-run: ${{ inputs.dry-run }} + new-version: ${{ steps.update-version.outputs.version }} diff --git a/.github/workflows/automated-release-nodejs.yml b/.github/workflows/automated-release-nodejs.yml index a10f334669..271292623f 100644 --- a/.github/workflows/automated-release-nodejs.yml +++ b/.github/workflows/automated-release-nodejs.yml @@ -29,9 +29,7 @@ on: jobs: release: runs-on: ubuntu-latest - timeout-minutes: 40 - if: inputs.enablerType == 'node' - + timeout-minutes: 10 steps: - uses: actions/checkout@v4 with: @@ -49,84 +47,26 @@ jobs: - name: Set name run: git config user.name "Zowe Robot" - - name: Update version manually - if: github.event.inputs.version != '' - run: | - cd onboarding-enabler-nodejs - sed -i.bak "s/\"version\": \".*\"/\"version\": \"$NEW_VERSION\"/" package.json - env: - NEW_VERSION: ${{ github.event.inputs.version }} - - - name: Release to NPM automatic - shell: bash - run: | - cd onboarding-enabler-nodejs - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc - npm version ${{ github.event.inputs.scope || env.DEFAULT_SCOPE }} - npm publish --access public - git add package.json - git add package-lock.json - git commit -m "[skip ci] Update version" - git push --no-verify - cd .. - env: - DEFAULT_SCOPE: 'patch' - NPM_TOKEN: ${{ secrets.NPM_PUBLIC_TOKEN }} - - - uses: ./.github/actions/teardown - - release-python-enabler: - runs-on: ubuntu-latest - timeout-minutes: 40 - needs: release - if: inputs.enablerType == 'python' - - steps: - name: Checkout Repository uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.ZOWE_ROBOT_TOKEN }} - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.14" - - - name: Install Dependencies - run: | - cd onboarding-enabler-python - python -m venv venv - source venv/bin/activate - python -m pip install --upgrade pip setuptools wheel twine build - if [ -f Pipfile.lock ]; then - pip install pipenv - pipenv install --deploy --ignore-pipfile - fi - - - name: Build Python Package - run: | - export SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.version }} - ./gradlew onboarding-enabler-python:buildPython - - - name: Upload wheels - uses: actions/upload-artifact@v4 + - name: Release NodeJS enabler + if: ${{ inputs.enablerType == 'node' }} + uses: ./.github/actions/release-nodejs-enabler with: - name: wheels - path: onboarding-enabler-python/dist/ - - - name: Install twine globally - run: python3 -m pip install --upgrade twine + version: ${{ github.event.inputs.version }} + npm-token: ${{ secrets.NPM_PUBLIC_TOKEN }} - - uses: zowe-actions/octorelease@v1 - env: - GIT_COMMITTER_NAME: ${{ secrets.ZOWE_ROBOT_USER }} - GIT_COMMITTER_EMAIL: ${{ secrets.ZOWE_ROBOT_EMAIL }} - GIT_CREDENTIALS: x-access-token:${{ secrets.ZOWE_ROBOT_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_ROBOT_TOKEN }} + - name: Release Python enabler + if: ${{ inputs.enablerType == 'python' }} + uses: ./.github/actions/release-python-enabler with: - working-dir: onboarding-enabler-python - dry-run: ${{ inputs.dry-run }} - new-version: ${{ steps.update-version.outputs.version }} + version: ${{ github.event.inputs.version }} + zowe-robot-user: ${{ secrets.ZOWE_ROBOT_USER }} + zowe-robot-email: ${{ secrets.ZOWE_ROBOT_EMAIL }} + zowe-robot-token: x-access-token:${{ secrets.ZOWE_ROBOT_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} + twine-password: ${{ secrets.PYPI_ROBOT_TOKEN }} diff --git a/onboarding-enabler-nodejs/package-lock.json b/onboarding-enabler-nodejs/package-lock.json index 00ba733edf..c5d55e1cbb 100644 --- a/onboarding-enabler-nodejs/package-lock.json +++ b/onboarding-enabler-nodejs/package-lock.json @@ -1,12 +1,12 @@ { "name": "@zowe/apiml-onboarding-enabler-nodejs", - "version": "3.2.5", + "version": "3.2.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@zowe/apiml-onboarding-enabler-nodejs", - "version": "3.2.5", + "version": "3.2.6", "license": "EPL-2.0", "dependencies": { "async": "3.2.6", diff --git a/onboarding-enabler-nodejs/package.json b/onboarding-enabler-nodejs/package.json index 2e48dabd74..42a1766c53 100644 --- a/onboarding-enabler-nodejs/package.json +++ b/onboarding-enabler-nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/apiml-onboarding-enabler-nodejs", - "version": "3.2.5", + "version": "3.2.6", "description": "NodeJS enabler for Zowe API Mediation Layer", "type": "module", "main": "src/index.js", diff --git a/onboarding-enabler-python/Pipfile b/onboarding-enabler-python/Pipfile index 697d9c0bf2..0c72209631 100644 --- a/onboarding-enabler-python/Pipfile +++ b/onboarding-enabler-python/Pipfile @@ -29,4 +29,4 @@ yarl = ">=1.20.0" [dev-packages] [requires] -python_version = "3.12" +python_version = "3.14"