Publish packages to NPM #6
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 packages to NPM | |
on: workflow_dispatch | |
jobs: | |
publish: | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: [windows-latest] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.IMJS_ADMIN_GH_TOKEN }} | |
lfs: true | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.12.0 | |
registry-url: https://registry.npmjs.org/ | |
- name: Install pnpm | |
uses: pnpm/[email protected] | |
with: | |
version: 7.28.0 | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile=true | |
- name: Build | |
run: pnpm build | |
- name: Run unit tests | |
env: | |
IMJS_UNIT_TESTS_PROJECT_ID: ${{ secrets.UNIT_TESTS_PROJECT_ID }} | |
IMJS_UNIT_TESTS_CLIENT_ID: ${{ secrets.UNIT_TESTS_CLIENT_ID }} | |
IMJS_UNIT_TESTS_SECRET: ${{ secrets.UNIT_TESTS_SECRET }} | |
run: pnpm coverage | |
- name: Run integration tests | |
env: | |
IMJS_INTEGRATION_TESTS_PROJECT_ID: ${{ secrets.INTEGRATION_TESTS_PROJECT_ID }} | |
IMJS_INTEGRATION_TESTS_CLIENT_ID: ${{ secrets.INTEGRATION_TESTS_CLIENT_ID }} | |
IMJS_INTEGRATION_TESTS_SECRET: ${{ secrets.INTEGRATION_TESTS_SECRET }} | |
IMJS_OIDC_BROWSER_TEST_CLIENT_ID: ${{ secrets.IMJS_OIDC_BROWSER_TEST_CLIENT_ID }} | |
IMJS_OIDC_BROWSER_TEST_REDIRECT_URI: ${{ vars.IMJS_OIDC_BROWSER_TEST_REDIRECT_URI }} | |
IMJS_OIDC_BROWSER_TEST_SCOPES: ${{ vars.IMJS_OIDC_BROWSER_TEST_SCOPES }} | |
IMJS_TEST_REGULAR_USER_NAME: ${{ vars.IMJS_TEST_REGULAR_USER_NAME }} | |
IMJS_TEST_REGULAR_USER_PASSWORD: ${{ secrets.IMJS_TEST_REGULAR_USER_PASSWORD }} | |
IMJS_TEST_MANAGER_USER_NAME: ${{ vars.IMJS_TEST_MANAGER_USER_NAME }} | |
IMJS_TEST_MANAGER_USER_PASSWORD: ${{ secrets.IMJS_TEST_MANAGER_USER_PASSWORD }} | |
run: pnpm integration-tests | |
- name: Publish packages | |
run: | | |
git config --local user.email [email protected] | |
git config --local user.name imodeljs-admin | |
pnpm publish-packages --new --branch ${{ github.ref_name }} --message "Version bump [skip actions]" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_ITWIN }} |