Skip to content

[impit-node] Release to npm #17

[impit-node] Release to npm

[impit-node] Release to npm #17

Workflow file for this run

name: "[impit-node] Release to npm"
env:
DEBUG: napi:*
APP_NAME: impit-node
MACOSX_DEPLOYMENT_TARGET: '10.13'
RUSTFLAGS: '--cfg reqwest_unstable'
permissions:
contents: write
id-token: write
'on':
workflow_dispatch:
inputs:
bump:
description: 'Bump version'
required: true
type: choice
default: 'patch'
options:
- 'major'
- 'minor'
- 'patch'
jobs:
test:
name: Build and test
uses: ./.github/workflows/node-test.yaml
secrets: inherit
publish:
defaults:
run:
working-directory: impit-node
name: Publish
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Enable Corepack
run: |
corepack enable
corepack prepare yarn@stable --activate
- name: Activate cache for Node.js
uses: actions/setup-node@v4
with:
cache: yarn
cache-dependency-path: impit-node/yarn.lock
- name: Install dependencies
run: yarn install
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Move artifacts
run: yarn artifacts
- name: List packages
run: ls -R ./npm
shell: bash
- name: Calculate version
id: get-new-version
run: |
echo ::set-output name=TARGET_VERSION::$(npx semver --increment ${{ github.event.inputs.bump }} $(npm show impit version))
- name: Set version
run: |
yarn version ${{ steps.get-new-version.outputs.TARGET_VERSION }}
yarn copy-version
- name: Publish to npm
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish --access public
env:
GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
- name: Commit changes
id: commit
uses: EndBug/add-and-commit@v9
with:
author_name: Apify Release Bot
author_email: noreply@apify.com
message: "chore(js-release): Update package version [skip ci]"
tag: "js-${{ steps.get-new-version.outputs.TARGET_VERSION }}"