Skip to content

ci: build fixes, --noEmit tsc, Dependabot and publish on any push to … #4

ci: build fixes, --noEmit tsc, Dependabot and publish on any push to …

ci: build fixes, --noEmit tsc, Dependabot and publish on any push to … #4

Workflow file for this run

name: Publish to npm

Check failure on line 1 in .github/workflows/publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/publish.yml

Invalid workflow file

(Line: 62, Col: 3): 'ci' is already defined
on:
push:
branches:
- production
jobs:
ci:
uses: ./.github/workflows/ci.yml
publish:
needs: ci
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Get package version
id: pkg
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Set npm tag
id: tag
run: |
VERSION=$(node -p "require('./package.json').version")
if [[ "$VERSION" == *"alpha"* ]]; then
echo "tag=alpha" >> $GITHUB_OUTPUT
elif [[ "$VERSION" == *"beta"* ]]; then
echo "tag=beta" >> $GITHUB_OUTPUT
elif [[ "$VERSION" == *"rc"* ]]; then
echo "tag=rc" >> $GITHUB_OUTPUT
else
echo "tag=latest" >> $GITHUB_OUTPUT
fi
- name: Publish to npm
run: npm publish --access public --tag ${{ steps.tag.outputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.pkg.outputs.version }}
name: v${{ steps.pkg.outputs.version }}
generate_release_notes: true
ci:
uses: ./.github/workflows/ci.yml