Skip to content

Commit

Permalink
ci: add labels sync, release and stale workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jan 14, 2025
1 parent dd73147 commit 449e446
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 249 deletions.
170 changes: 0 additions & 170 deletions .github/labels.json

This file was deleted.

23 changes: 0 additions & 23 deletions .github/lock.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/stale.yml

This file was deleted.

58 changes: 27 additions & 31 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,56 @@ name: checks
on:
- push
- pull_request

- workflow_call
jobs:
# Note : i didn't inherited from the org workflow since we need to install pnpm in this
# workflow. we may need to add a new input to the org workflow to enable/disable pnpm
# installation

test_linux:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["lts/iron", "lts/jod", "latest"]
node-version: ['lts/iron', 'lts/jod', 'latest']

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install pnpm
run: npm install -g pnpm
- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: npm install
- name: Install dependencies
run: npm install

- name: Run tests
run: npm test
- name: Run tests
run: npm test

test_windows:
if: ${{ !inputs.disable-windows }}
runs-on: windows-latest
strategy:
matrix:
node-version: ["lts/iron", "lts/jod", "latest"]
node-version: ['lts/iron', 'lts/jod', 'latest']

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install pnpm
run: npm install -g pnpm
- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: npm install
- name: Install dependencies
run: npm install

- name: Run tests
run: npm test
- name: Run tests
run: npm test

lint:
uses: japa/.github/.github/workflows/lint.yml@main
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Sync labels
on:
workflow_dispatch:
permissions:
issues: write
jobs:
labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EndBug/label-sync@v2
with:
config-file: 'https://raw.githubusercontent.com/thetutlage/static/main/labels.yml'
delete-other-labels: true
token: ${{ secrets.GITHUB_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: release
on: workflow_dispatch
permissions:
contents: write
id-token: write
jobs:
checks:
uses: ./.github/workflows/checks.yml
release:
needs: checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Init npm config
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm install
- run: npm run release -- --ci
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 0 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
stale-issue-message: 'This issue has been marked as stale because it has been inactive for more than 21 days. Please reopen if you still need help on this issue'
stale-pr-message: 'This pull request has been marked as stale because it has been inactive for more than 21 days. Please reopen if you still intend to submit this pull request'
close-issue-message: 'This issue has been automatically closed because it has been inactive for more than 4 weeks. Please reopen if you still need help on this issue'
close-pr-message: 'This pull request has been automatically closed because it has been inactive for more than 4 weeks. Please reopen if you still intend to submit this pull request'
days-before-stale: 21
days-before-close: 5
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

0 comments on commit 449e446

Please sign in to comment.