Change CI/CD workflows #4
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: Release @dev tag to npm | |
on: [pull_request] | |
jobs: | |
release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 | |
with: | |
run_install: | | |
- args: [--frozen-lockfile] | |
- run: pnpm build | |
- run: | | |
VERSION=$(cat package.json | jq -r '.version') | |
echo "VERSION=$VERSION" >> "$GITHUB_ENV" | |
- uses: peter-evans/create-or-update-comment@v4 | |
env: | |
VERSION: ${{ env.VERSION }} | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
Released snapshot build with `@dev` tag in npm with version: `${{ env.VERSION }}`. | |
Install it with: | |
```shell | |
pnpm add @saleor/app-sdk@${{ env.VERSION }} | |
``` | |
- name: Check for changeset | |
run: | | |
pnpm exec changeset status --since origin/main | |
- name: Create .npmrc | |
run: | | |
cat << EOF > "$HOME/.npmrc" | |
//registry.npmjs.org/:_authToken=$NPM_TOKEN | |
EOF | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Release on @dev tag in npm | |
run: pnpm exec changeset version --snapshot pr && pnpm publish --tag dev --no-git-checks |