forked from mysticatea/eslint-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(CI): add automatic release (#8)
- Loading branch information
1 parent
577e221
commit 1cc30ef
Showing
12 changed files
with
82 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,44 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: [main] | ||
branches: | ||
# default semantic-release branches | ||
- +([0-9])?(.{+([0-9]),x}).x | ||
- main | ||
- next | ||
- next-major | ||
- beta | ||
- alpha | ||
pull_request: | ||
schedule: | ||
- cron: 0 0 * * 0 | ||
|
||
jobs: | ||
lint: | ||
name: ⬣ Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Node | ||
- name: ⎔ Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install Packages | ||
- name: 📥 Install dependencies | ||
run: npm install | ||
|
||
- name: Lint | ||
- name: ▶️ Run lint script | ||
run: npm run lint | ||
|
||
test: | ||
name: Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{ matrix.os }}) | ||
name: | ||
🧪 Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{ | ||
matrix.os }}) | ||
strategy: | ||
matrix: | ||
eslint: [6] | ||
|
@@ -45,24 +58,65 @@ jobs: | |
os: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Node@${{ matrix.node }} | ||
- name: ⎔ Setup Node v${{ matrix.node }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install Packages | ||
- name: 📥 Install dependencies | ||
run: npm install | ||
|
||
# - name: Install ESLint@${{ matrix.eslint }} | ||
# run: npm install eslint@${{ matrix.eslint }} | ||
# - name: 📥 Install ESLint v${{ matrix.eslint }} | ||
# run: npm install --save-dev eslint@${{ matrix.eslint }} | ||
|
||
- name: Test | ||
- name: ▶️ Run test script | ||
run: npm run test | ||
|
||
# - name: Send Coverage | ||
# run: npm run -s codecov | ||
# env: | ||
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
- name: ⬆️ Upload coverage report | ||
uses: codecov/codecov-action@v3 | ||
|
||
release: | ||
name: 🚀 Release | ||
needs: [lint, test] | ||
runs-on: ubuntu-latest | ||
if: | ||
github.repository == 'eslint-community/eslint-plugin-mysticatea' && | ||
contains('refs/heads/main,refs/heads/next,refs/heads/beta,refs/heads/alpha', | ||
github.ref) && github.event_name == 'push' | ||
steps: | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: 📥 Install dependencies | ||
run: npm install | ||
|
||
- name: 🚀 Release | ||
uses: cycjimmy/semantic-release-action@v3 | ||
with: | ||
semantic_version: 19 | ||
branches: | | ||
[ | ||
'+([0-9])?(.{+([0-9]),x}).x', | ||
'main', | ||
'next', | ||
'next-major', | ||
{name: 'beta', prerelease: true}, | ||
{name: 'alpha', prerelease: true} | ||
] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
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
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
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
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
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
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
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
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
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
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
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