chore: all setup #18
Workflow file for this run
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: "Askar Wrapper Javascrip" | |
permissions: | |
actions: write | |
contents: write | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
continous-integration: | |
name: Continous Integration | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: library-linux-x86_64.tar.gz | |
repository: openwallet-foundation/askar | |
path: packages/askar-nodejs/native | |
- run: ls -R packages/askar-nodejs/native | |
- name: Set up Node.JS 18.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Install dependencies | |
run: pnpm install | |
- name: Lint | |
run: pnpm style:check | |
- name: Build library | |
run: pnpm build | |
- name: Check types | |
run: pnpm types:check | |
- name: Run tests | |
run: pnpm test | |
continous-deployment: | |
if: github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-latest | |
needs: ['continous-integration'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Node.JS 18.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build library | |
run: pnpm build | |
- name: Set NPM config | |
if: | | |
github.event_name == 'release' || | |
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-javascript-wrapper == 'true') | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc | |
echo "registry=https://registry.npmjs.org/" >> .npmrc | |
echo "always-auth=true" >> .npmrc | |
- name: Publish JavaScript Wrapper | |
if: | | |
github.event_name == 'release' || | |
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-javascript-wrapper == 'true') | |
run: | | |
if [[ $(cat lerna.json | grep version | head -1 | grep dev) ]]; then | |
npx lerna publish from-package --no-push --no-private --yes --no-git-tag-version --dist-tag=alpha | |
else | |
npx lerna publish from-package --no-push --no-private --yes --no-git-tag-version | |
fi |