-
Notifications
You must be signed in to change notification settings - Fork 1
feat: linting pipeline #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| build-and-test: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [22.x] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Enable Corepack | ||
| run: corepack enable | ||
|
|
||
| - name: Setup Node.js & cache npm | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: npm | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install --frozen-lockfile | ||
|
|
||
| - name: Lint code | ||
| run: npm run lint | ||
|
|
||
| - name: Type-check | ||
| run: npx tsc --noEmit | ||
|
|
||
| - name: Build project | ||
| run: npm run build | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: Release & Publish Apify n8n Node | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| build_and_release: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Node.js and cache npm | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22.x' | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build project | ||
| run: npm run build | ||
|
|
||
| - name: Run tests | ||
| run: npm test | ||
|
|
||
| - name: Configure Git | ||
| run: | | ||
| git config --global user.name "Apify Release Bot" | ||
| git config --global user.email "noreply@apify.com" | ||
|
|
||
| - name: Extract release version | ||
| id: get_version | ||
| run: | | ||
| FULL_TAG_NAME="${{ github.event.release.tag_name }}" | ||
| VERSION_NUMBER="${FULL_TAG_NAME#v}" | ||
| echo "VERSION=${VERSION_NUMBER}" >> $GITHUB_ENV | ||
|
|
||
| - name: Update package.json version | ||
| run: | | ||
| echo "Updating package.json to version ${{ env.VERSION }}" | ||
| npm version ${{ env.VERSION }} --no-git-tag-version | ||
|
|
||
| - name: Commit version update | ||
| run: | | ||
| git add package.json package-lock.json | ||
| if ! git diff --staged --quiet; then | ||
| TARGET_BRANCH="${{ github.event.release.target_commitish }}" | ||
| echo "Target branch for push: $TARGET_BRANCH" | ||
| git commit -m "chore(release): set version to ${{ env.VERSION }} [skip ci]" | ||
| echo "Pushing version update to branch: $TARGET_BRANCH" | ||
| git push origin HEAD:"refs/heads/$TARGET_BRANCH" | ||
| else | ||
| echo "No changes to commit in package.json or package-lock.json for version update." | ||
| fi | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} | ||
|
|
||
| - name: Set up npm authentication | ||
| run: echo "//registry.npmjs.org/:_authToken=${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}" > ~/.npmrc | ||
|
|
||
| - name: Publish to npm | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }} | ||
| run: | | ||
| if npm view @apify/n8n-nodes-apify-actor-template@${{ env.VERSION }} version > /dev/null 2>&1; then | ||
| echo "Version ${{ env.VERSION }} of @apify/n8n-nodes-apify-actor-template is already published to npm. Skipping publish step." | ||
| else | ||
| echo "Publishing @apify/n8n-nodes-apify-actor-template@${{ env.VERSION }} to npm..." | ||
| npm publish --access public | ||
| fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Artifact left by
pnpm, should probably unify tonpm cixd